NovaVMware/Documentation

= OpenStack + VMware documentation =

SOAP WSDL issues
If you are using OpenStack with vSphere API's version 5.1 or newer then you may ignore this section.

If you are using OpenStack Nova compute driver with grizzly or havana along side vSphere API version 5.0 or earlier you may have a WSDL parse exception on driver initialization. This is due to the sensitivity of the Python XML parser. It will not tolerate missing XML or slightly malformed XML. Version 5.1 and later of vCenter have addressed this issue and made their WSDL files Python friendly. For the time being if you do not have one of these newer versions you will have to use a common work-around included in the driver since Grizzly-2 was released in January of 2013.

cache wsdl locally
assuming you have followed this guide NovaVMware/DeveloperGuide and setup your ~/devstack/localrc (or otherwise set your vCenter or ESXi IP in a shell variable) you can follow these steps.

$ cd ~/devstack $ source localrc $ echo $VMWAREAPI_IP ... should echo your vCenter or ESXi host IP address ...

Now we need a local directory to store the WSDL in. $ mkdir -p /opt/stack/wsdl $ cd /opt/stack/wsdl

Next, we will grab the WSDL over the network and cache it locally in this directory. $ wget --no-check-certificate https://$VMWAREAPI_IP/sdk/vimService.wsdl $ wget --no-check-certificate https://$VMWAREAPI_IP/sdk/vim.wsdl $ wget --no-check-certificate https://$VMWAREAPI_IP/sdk/core-types.xsd $ wget --no-check-certificate https://$VMWAREAPI_IP/sdk/query-messagetypes.xsd $ wget --no-check-certificate https://$VMWAREAPI_IP/sdk/query-types.xsd $ wget --no-check-certificate https://$VMWAREAPI_IP/sdk/reflect-messagetypes.xsd $ wget --no-check-certificate https://$VMWAREAPI_IP/sdk/reflect-types.xsd $ wget --no-check-certificate https://$VMWAREAPI_IP/sdk/vim-messagetypes.xsd

Now, we need to modify the WSDL so that Python will not complain about it. We will add two files to the directory we cached the WSDL files in.

Contents of both reflect-messagetypes.xsd and reflect-types.xsd  

NOTE: The Python parser is very sensitive. A misplaced space, new-line, or any character that is out of place, visible or not, will cause the parser to fail with a cryptic warning. You may have to edit these two files a few times to get things just right.

Now that we have a local copy of the WSDL file XML we can setup Nova to read these instead of the files on the server.

set nova.conf to read local WSDL cache
In nova.conf you will set either vmwareapi_wsdl_loc or in the [vmware] section you will set wsdl_location if you are using a version of the driver newer than Havana-3.

Add to the end of nova.conf pre-Havana vmwareapi_wsdl_loc = file:///opt/stack/wsdl/vimService.wsdl

Add to the [vmware] section of the nova.conf post-Havana wsdl_loc = file:///opt/stack/wsdl/vimService.wsdl

vCenter configuration
If you are using the bare driver for ESX or ESXi you may skip this step.

Once you have a nova-compute driver that can successfully hand-shake with vCenter you will need to configure vCenter in a way that makes sense with your driver. As late as Havana (2013.2) the vCenter driver may not function properly if the vCenter inventory has not been configured properly. In particular, the presence of more than one DataCenter (not to be confused with a DataStore which is a wholly different construct) is present in the inventory, the driver may have difficulty determining which of the resource trees it should be talking to. It is advisable to run a vCenter with a single DataCenter unless you are using the Cluster feature of the driver and only if you are using the clustered feature in a specific way.

Should you not be using vCenter with clusters, consider using a single DataCenter and a single ESXi host or similar flat hierarchy.