vCO: Server Decommission Workflow


Comparing to the server provisioning and VM archive, this workflow is a little bit more complicated. What it does is Checking the power status –> Shutdown VM if it is running –> Archive the VM –> Send requester the archive results –> Ask user to confirm whether to remove the VM –> Send the result to requester.

image

The key steps are:

1) Check the power status in the Custom decision

var powerState = vm.runtime.powerState.value;

System.log (powerState);

if (powerState == ‘poweredOff’) {
return true;
} else {
return false;
}

2) Add the VM archive workflow which I created already.

3) Set a boolean type parameter in the User Interaction which allow user to choose Yes or No.

image

Custom decision based on user’s choice.

System.log (choice);

if (choice == true) {
return true;
} else {
return false;
}

This is how it looks like when running:

image

image

image

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s