Query Guest OS Customization Status with vCloud API

Very useful new feature of vCloud Director 8.10 is the possibility to query with vCloud API guest OS customization status. Typical use case is when the tenant runs custom orchestration to deploy VM and install and configure application in it. When the VM is powered-on for the first time, the operating system boots up and vCloud Director runs customization scripts to set identity (hostname, SID), networking, administrator password, etc. Read Massimo’s blog for deep dive into guest cutomization.

Tenant’s custom orchestration then needs to wait for the customization to finish and then finally log into the VM and proceed with the application installation and configuration. The problem in the past was that there was no easy way to find out if the guest customization was finished. Not anymore.

With vCloud API you can easily query the vApp VM to get its customization status.

Example:

GET https://vcd-01a.corp.local/api/vApp/vm-22e51563-52a6-4a13-961a-d9dffa6aabf5/guestcustomizationstatus	
	
<?xml version="1.0" encoding="UTF-8"?>
<GuestCustomizationStatusSection xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://vcd-01a.corp.local/api/v1.5/schema/master.xsd">
	    <GuestCustStatus>GC_PENDING</GuestCustStatus>
</GuestCustomizationStatusSection>

The possible guest customization states are:

  • GC_PENDING: Guest Customization is either not started or in progress.
  • REBOOT_PENDING: Guest Customization is successful, but reboot is pending.
  • GC_FAILED: Guest Customization failed, error is logged.
  • POST_GC_PENDING: Reboot has happened, waiting for post customization script to complete
  • GC_COMPLETE: Guest customization is complete
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