Atom feed of this document
 

 Hyper-V virtualization platform

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

 Hyper-V configuration

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.

 Configure NTP

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 will need to run the following commands

C:\net stop w32time
        
C:\w32tm /config /manualpeerlist:pool.ntp.org,0x8 /syncfromflags:MANUAL
        
C:\net start w32time
        
 Configure Hyper-V virtual switching

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
 Enable iSCSI initiator service

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"
        
 Configure shared nothing live migration

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.

  1. The target hosts ensures that live migration is enabled and properly configured in Hyper-V.

  2. 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.

  3. The source hosts ensures that live migration is enabled and properly configured in Hyper-V.

  4. The source hosts initiates a Hyper-V live migration.

  5. 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]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 Requirements

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:

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

The following packages need to be downloaded and manually installed onto the Compute Node

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_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

 Install Nova-compute

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
        
 Configure Nova.conf

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

The following table contains a reference of all options for hyper-v

Table 2.26. Description of configuration options for hyperv
Configuration option=Default value Description
dynamic_memory_ratio=1.0 (FloatOpt) Enables dynamic memory allocation (ballooning) when set to a value greater than 1. The value expresses the ratio between the total RAM assigned to an instance and its startup RAM amount. For example a ratio of 2.0 for an instance with 1024MB of RAM implies 512MB of RAM allocated at startup
enable_instance_metrics_collection=False (BoolOpt) Enables metrics collections for an instance by using Hyper-V's metric APIs. Collected data can by retrieved by other apps and services, e.g.: Ceilometer. Requires Hyper-V / Windows Server 2012 and above
force_hyperv_utils_v1=False (BoolOpt) Force V1 WMI utility classes
instances_path_share= (StrOpt) The name of a Windows share name mapped to the "instances_path" dir and used by the resize feature to copy files to the target host. If left blank, an administrative share will be used, looking for the same "instances_path" used locally
limit_cpu_features=False (BoolOpt) Required for live migration among hosts with different CPU features
qemu_img_cmd=qemu-img.exe (StrOpt) qemu-img is used to convert between different image types
vswitch_name=None (StrOpt) External virtual switch Name, if not provided, the first external virtual switch is used

 Prepare images for use with 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
    
 Run Compute with Hyper-V

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
    
 Troubleshoot Hyper-V configuration
  • 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

Log a bug against this page


loading table of contents...