Hyper-V Virtualization PlatformIt is possible to use Hyper-V as a compute node within an OpenStack Deployment. The
nova-compute service runs as "openstack-compute," a 32-bit service directly upon the Windows
platform with the Hyper-V role enabled. The necessary Python components as well as the
nova-compute service are installed directly onto the Windows platform. Windows Clustering
Services are not needed for functionality within the OpenStack infrastructure. The use of
the Windows Server 2012 platform is recommend for the best experience and is the platform
for active development. The following Windows platforms have been tested as compute nodes:Windows Server 2008r2Both Server and Server Core with the Hyper-V role enabled (Shared Nothing Live
migration is not supported using 2008r2)Windows Server 2012Server and Core (with the Hyper-V role enabled), and Hyper-V ServerHyper-V ConfigurationThe following sections discuss how to prepare the Windows Hyper-V node for operation
as an OpenStack Compute node. Unless stated otherwise, any configuration information
should work for both the Windows 2008r2 and 2012 platforms.Local Storage ConsiderationsThe Hyper-V compute node needs to have ample storage for storing the virtual machine
images running on the compute nodes. You may use a single volume for all, or partition
it into an OS volume and VM volume. It is up to the individual deploying to
decide.Configure NTPNetwork time services must be configured to ensure proper operation of the Hyper-V
compute node. To set network time on your Hyper-V host you will need to run the
following commandsC:\net stop w32timeC:\w32tm /config /manualpeerlist:pool.ntp.org,0x8 /syncfromflags:MANUALC:\net start w32timeConfiguring Hyper-V Virtual SwitchingInformation regarding the Hyper-V virtual Switch can be located here: http://technet.microsoft.com/en-us/library/hh831823.aspx
To quickly enable an interface to be used as a Virtual Interface the following
PowerShell may be used:PS C:\$if = Get-NetIPAddress –IPAddress 192* | Get-NetIPInterfacePS C:\New-VMSwitch -NetAdapterName $if.ifAlias -Name yourbridgename –AllowManagementOS $falseEnable iSCSI Initiator ServiceTo prepare the Hyper-V node to be able to attach to volumes provided by cinder
you must first make sure the Windows iSCSI initiator service is running and
started automatically.C:\sc start MSiSCSIC:\sc config MSiSCSI start="auto"Configuring Shared Nothing Live MigrationDetailed information on the configuration of live migration can be found here: http://technet.microsoft.com/en-us/library/jj134199.aspxThe following outlines the steps of shared nothing live migration.The target hosts ensures that live migration is enabled and properly
configured in Hyper-V.The target hosts checks if the image to be migrated requires a base VHD and
pulls it from Glance if not already available on the target host.The source hosts ensures that live migration is enabled and properly
configured in Hyper-V.The source hosts initiates a Hyper-V live migration.The source hosts communicates to the manager the outcome of the
operation.The following two configuration options/flags are needed in order to support Hyper-V
live migration and must be added to your nova.conf on the Hyper-V
compute node:instances_shared_storage=FalseThis needed to support "shared nothing" Hyper-V live migrations. It is
used in nova/compute/manager.pylimit_cpu_features=TrueThis flag is needed to support live migration to hosts with different CPU
features. This flag is checked during instance creation in order to limit
the CPU features used by the VM.instances_path=DRIVELETTER:\PATH\TO\YOUR\INSTANCESAdditional Requirements:Hyper-V 2012 RC or Windows Server 2012 RC with Hyper-V role enabledA Windows domain controller with the Hyper-V compute nodes as domain
membersThe instances_path command line option/flag needs to be the same on all
hostsThe openstack-compute service deployed with the setup must run with domain
credentials. You can set the service credentials with:C:\sc config openstack-compute obj="DOMAIN\username" password="password"How to setup live migration on Hyper-VTo enable shared nothing live migration run the 3 PowerShell instructions below on
each Hyper-V host:PS C:\Enable-VMMigrationPS C:\Set-VMMigrationNetwork IP_ADDRESSPS C:\Set-VMHost –VirtualMachineMigrationAuthenticationTypeKerberosPlease replace the IP_ADDRESS with the address of the interface which will provide
the virtual switching for nova-network.Additional ReadingHere's an article that clarifies the various live migration options in Hyper-V:
http://ariessysadmin.blogspot.ro/2012/04/hyper-v-live-migration-of-windows.html
"Python Requirements"PythonPython 2.7.3 must be installed prior to installing the OpenStack Compute Driver on the
Hyper-V server. Download and then install the MSI for windows here:
http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi
Install the MSI accepting the default options.The installation will put python in C:/python27.SetuptoolsYou will require pip to install the necessary python module dependencies. The
installer will install under the C:\python27 directory structure. Setuptools for Python
2.7 for Windows can be download from here: http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11.win32-py2.7.exe
Python DependenciesThe following packages need to be downloaded and manually installed onto the Compute
NodeMySQL-python
http://codegood.com/download/10/
pywin32Download and run the installer from the following location
http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/pywin32-217.win32-py2.7.exe
greenletSelect the link below:http://www.lfd.uci.edu/~gohlke/pythonlibs/You will need to scroll down to the greenlet section for the following file:
greenlet-0.4.0.win32-py2.7.exeClick on the file, to initiate the download. Once the download is complete,
run the installer.The following python packages need to be installed via easy_install or pip. Run the
following replacing PACKAGENAME with the packages below:C:\c:\Python27\Scripts\pip.exe install PACKAGE_NAMEamqplibanyjsondistributeeventlethttplib2iso8601jsonschemakombunetaddrpastepaste-deployprettytablepython-cinderclientpython-glanceclientpython-keystoneclientrepoze.lruroutessqlalchemysimplejsonwarlockwebobwmiInstalling Nova-computeUsing git on Windows to retrieve sourceGit be used to download the necessary source code. The installer to run Git on Windows
can be downloaded here:
http://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git
Download the latest installer. Once the download is complete double click the
installer and follow the prompts in the installation wizard. The default should be
acceptable for the needs of the document.Once installed you may run the following to clone the Nova code.C:\git.exe clone https://github.com/openstack/nova.gitConfiguring Nova.confThe nova.conf file must be placed in
C:\etc\nova for running OpenStack on Hyper-V. Below is a sample
nova.conf for Windows:[DEFAULT]
verbose=true
force_raw_images=false
auth_strategy=keystone
fake_network=true
vswitch_name=openstack-br
logdir=c:\openstack\
state_path=c:\openstack\
lock_path=c:\openstack\
instances_path=e:\Hyper-V\instances
policy_file=C:\Program Files (x86)\OpenStack\nova\etc\nova\policy.json
api_paste_config=c:\openstack\nova\etc\nova\api-paste.ini
rabbit_host=IP_ADDRESS
glance_api_servers=IP_ADDRESS:9292
image_service=nova.image.glance.GlanceImageService
instances_shared_storage=false
limit_cpu_features=true
compute_driver=nova.virt.hyperv.driver.HyperVDriver
volume_api_class=nova.volume.cinder.API
[database]
connection=mysql://nova:passwd@IP_ADDRESS/novaThe following table contains a reference of all optionsfor hyper-vPreparing Images for use with Hyper-VHyper-V currently supports only the VHD file format for virtual machine instances.
Detailed instructions for installing virtual machines on Hyper-V can be found
here:http://technet.microsoft.com/en-us/library/cc772480.aspxOnce you have successfully created a virtual machine, you can then upload the image to
glance using the native glance-client:C:\glance image-create --name="VM_IMAGE_NAME" --is-public=true --container-format=bare --disk-format=vhdRunning Compute with Hyper-VTo start the nova-compute service, run this command from a console in the Windows
server:C:\C:\python27\python.exe c:\openstack\nova\bin\nova-compute.pyTroubleshooting Hyper-V ConfigurationI ran the nova-manage service list command from my
controller; however, I'm not seeing smiley faces for Hyper-V compute nodes, what
do I do?Verify that you are synchronized with a network time
source. Instructions for configuring NTP on your Hyper-V compute node are
located here