Jump to: navigation, search


< NovaVMware
Revision as of 22:13, 9 August 2013 by Hartsock (talk | contribs) (nova-compute driver configuration)

OpenStack + VMware documentation

nova-compute driver configuration

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#Setup_localrc_for_DevStack] 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

... should echo your vCenter or ESXi host IP address ...

Now we need a local directory to store the WSDL in.

$ mkdir -p /op/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

<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="urn:reflect" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

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

cluster configuration

datastore configuration

VMDK working types

thick versus thin provisioned

flat versus sparse