It 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 2008r2
Both Server and Server Core with the Hyper-V role enabled (Shared Nothing Live migration is not supported using 2008r2)
Windows Server 2012
Server and Core (with the Hyper-V role enabled), and Hyper-V Server
The 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 Considerations
The 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.
Network 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 must run the following commands:
C:\>net stop w32time C:\>w32tm /config /manualpeerlist:pool.ntp.org,0x8 /syncfromflags:MANUAL C:\>net start w32time
Information 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-NetIPInterface PS C:\>New-VMSwitch -NetAdapterName $if.ifAlias -Name yourbridgename –AllowManagementOS $false
To 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 MSiSCSI C:\>sc config MSiSCSI start="auto"
Detailed information on the configuration of live migration can be found here: http://technet.microsoft.com/en-us/library/jj134199.aspx
The 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 the Image Service 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=False
This needed to support "shared nothing" Hyper-V live migrations. It is used in nova/compute/manager.py
limit_cpu_features=True
This 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\INSTANCES
Additional Requirements:
Hyper-V 2012 RC or Windows Server 2012 RC with Hyper-V role enabled
A Windows domain controller with the Hyper-V compute nodes as domain members
The instances_path command-line option/flag needs to be the same on all hosts.
The
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-V
To enable 'shared nothing live' migration, run the 3 PowerShell instructions below on each Hyper-V host:
PS C:\>Enable-VMMigration
PS C:\>Set-VMMigrationNetwork IP_ADDRESS
PS C:\>Set-VMHost –VirtualMachineMigrationAuthenticationTypeKerberos
Note | |
---|---|
Please replace the IP_ADDRESS with the address of the interface which will provide the virtual switching for nova-network. |
Additional Reading
Here'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
Python 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:
Install the MSI accepting the default options.
The installation will put python in C:/python27.
Setuptools
You 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 Dependencies
You must download and manually install the following packages on the Compute node:
MySQL-python
pywin32
Download and run the installer from the following location
http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/pywin32-217.win32-py2.7.exe
greenlet
Select the link below:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
You must scroll to the greenlet section for the following file: greenlet-0.4.0.win32-py2.7.exe
Click on the file, to initiate the download. Once the download is complete, run the installer.
You must install the following Python packages through easy_install or pip. Run the following replacing PACKAGENAME with the following packages:
C:\>c:\Python27\Scripts\pip.exe install PACKAGE_NAME
amqplib
anyjson
distribute
eventlet
httplib2
iso8601
jsonschema
kombu
netaddr
paste
paste-deploy
prettytable
python-cinderclient
python-glanceclient
python-keystoneclient
repoze.lru
routes
sqlalchemy
simplejson
warlock
webob
wmi
Using git on Windows to retrieve source
Git 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.git
The 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
/nova
Table 2.28, “Description of configuration options for hyperv” contains a reference of all options for hyper-v.
Hyper-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.aspx
Once 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=vhd
To 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.py
I 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