Module Expr Str Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Dict Num Num Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Dict Str Str Str Str Str Str Num Num Num Num Num Num Assign NameStore Num Assign NameStore Num Assign NameStore Num FunctionDef arguments args NameParam defaults body Global identifier If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad Str Return Call NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Pass decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Raise Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str NameLoad Assign NameStore NameLoad If SubscriptLoad NameLoad Index Str body Assign NameStore SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Str Index Num Index Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad Str AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Index Num Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Str Assign TupleStore NameStore NameStore SubscriptLoad Call AttributeLoad NameLoad attr ListLoad NameLoad Call AttributeLoad NameLoad attr Num Slice Num If CompareEq NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore CompareEq NameLoad Num If UnaryOpNot NameLoad body Raise Call NameLoad Call NameLoad Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad Str AttributeLoad NameLoad attr Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore SubscriptLoad ListComp NameLoad comprehension NameStore NameLoad CompareEq AttributeLoad NameLoad attr Num Index Num Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr keyword Str Index Num Assign NameStore Call NameLoad Call NameLoad SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Call NameLoad Str AttributeLoad NameLoad attr Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr keyword Str Index Num Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Call NameLoad Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr BinOpMod Call NameLoad Str Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Num attr keyword Str Assign NameStore ListComp NameLoad comprehension NameStore NameLoad BoolOpAnd CompareEq AttributeLoad NameLoad attr Str CompareEq AttributeLoad NameLoad attr Str Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Index Num Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad SubscriptLoad NameLoad Index Num attr Assign AttributeStore NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIs NameLoad NameLoad body Raise Call NameLoad Call NameLoad Str NameLoad Assign NameStore SubscriptLoad NameLoad Index Num Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Index Num Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIs NameLoad NameLoad body Raise Call NameLoad Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Index Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore ListComp NameLoad comprehension NameStore NameLoad CompareGt Call AttributeLoad AttributeLoad NameLoad attr attr Str Num Assign NameStore Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Str Call AttributeLoad NameLoad attr If CompareNotEq NameLoad Num body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Raise Call NameLoad Call NameLoad Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpMod Call NameLoad Str Call NameLoad Assign AttributeStore NameLoad attr ListLoad NameLoad Assign AttributeStore NameLoad attr BinOpAdd NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareIs NameLoad NameLoad body Raise Call NameLoad Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Index Num Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr Assign NameStore NameLoad If CompareEq NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore CompareEq NameLoad Num If NameLoad body Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad If CompareEq Call NameLoad NameLoad Num body Return NameLoad Assign NameStore SubscriptLoad NameLoad Index Num While CompareEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Num Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Index Num If CompareNotEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Str AttributeLoad NameLoad attr Return NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpMod Call NameLoad Str Call NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str If CompareEq Call NameLoad NameLoad Num body Return NameLoad Return SubscriptLoad Call AttributeLoad SubscriptLoad Call AttributeLoad SubscriptLoad Call AttributeLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Index Num attr keyword Str Index Num attr keyword Str Index Num attr keyword Str Index Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body Assign AttributeStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Raise Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Expr Call AttributeLoad NameLoad attr Call NameLoad Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Return Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr Index Num Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Index Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Num attr keyword Str Assign NameStore ListComp NameLoad comprehension NameStore NameLoad CompareEq AttributeLoad NameLoad attr Str Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr ListComp NameLoad comprehension NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr If CompareEq NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq NameLoad Num body Assign NameStore NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad BinOpMod Call NameLoad Str AttributeLoad NameLoad attr For NameStore NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpMod Call NameLoad Str Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Raise Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Index Num Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Index Num Assign NameStore Call AttributeLoad NameLoad attr keyword Str Assign NameStore ListComp Call AttributeLoad NameLoad attr comprehension NameStore NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr ListLoad Num Num Num Num NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad SubscriptLoad NameLoad Index AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpMod Call NameLoad Str Call NameLoad Return Dict Str Str Str Str Str SubscriptLoad NameLoad Index AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad Assign NameStore Call NameLoad NameLoad If CompareEq NameLoad Num body Return NameLoad orelse If CompareGt NameLoad Num body Raise Call NameLoad BinOpMod Call NameLoad Str NameLoad orelse Return AttributeLoad SubscriptLoad NameLoad Index Num attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad If CompareEq Call NameLoad NameLoad Num body Return NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad SubscriptLoad NameLoad Index Num attr SubscriptLoad NameLoad Index NameLoad Assign NameStore NameLoad If CompareEq NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq NameLoad Num body Assign NameStore NameLoad orelse If CompareEq NameLoad Num body Assign NameStore NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Call NameLoad Str Call NameLoad orelse Assign NameStore BinOpMod Call NameLoad Str Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Raise Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Raise Call AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Raise Call AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Pass decorator_list decorator_list
N/A N/A 
A connection to Hyper-V .
Uses Windows Management Instrumentation (WMI) calls to interact with Hyper-V
Hyper-V WMI usage:
    http://msdn.microsoft.com/en-us/library/cc723875%28v=VS.85%29.aspx
The Hyper-V object model briefly:
    The physical computer and its hosted virtual machines are each represented
    by the Msvm_ComputerSystem class.

    Each virtual machine is associated with a
    Msvm_VirtualSystemGlobalSettingData (vs_gs_data) instance and one or more
    Msvm_VirtualSystemSettingData (vmsetting) instances. For each vmsetting
    there is a series of Msvm_ResourceAllocationSettingData (rasd) objects.
    The rasd objects describe the settings for each device in a VM.
    Together, the vs_gs_data, vmsettings and rasds describe the configuration
    of the virtual machine.

    Creating new resources such as disks and nics involves cloning a default
    rasd object and appropriately modifying the clone and calling the
    AddVirtualSystemResources WMI method
    Changing resources such as memory uses the ModifyVirtualSystemResources
    WMI method

Using the Python WMI library:
    Tutorial:
        http://timgolden.me.uk/python/wmi/tutorial.html
    Hyper-V WMI objects can be retrieved simply by using the class name
    of the WMI object and optionally specifying a column to filter the
    result set. More complex filters can be formed using WQL (sql-like)
    queries.
    The parameters and return tuples of WMI method calls can gleaned by
    examining the doc string. For example:
    >>> vs_man_svc.ModifyVirtualSystemResources.__doc__
    ModifyVirtualSystemResources (ComputerSystem, ResourceSettingData[])
                 => (Job, ReturnValue)'
    When passing setting data (ResourceSettingData) to the WMI method,
    an XML representation of the data is passed in using GetText_(1).
    Available methods on a service can be determined using method.keys():
    >>> vs_man_svc.methods.keys()
    vmsettings and rasds for a vm can be retrieved using the 'associators'
    method with the appropriate return class.
    Long running WMI commands generally return a Job (an instance of
    Msvm_ConcreteJob) whose state can be polled to determine when it finishes

 N/A os N/A time nova exception nova flags nova log logging nova.compute power_state nova.virt driver nova.virt images N/A wmi None N/A FLAGS N/A flags FLAGS N/A LOG N/A N/A logging getLogger nova.virt.hyperv N/A HYPERV_POWER_STATE N/A 3 2 32768 N/A power_state SHUTDOWN N/A power_state RUNNING N/A power_state PAUSED N/A REQ_POWER_STATE N/A Enabled Disabled Reboot Reset Paused Suspended 2 3 10 11 32768 32769 N/A WMI_JOB_STATUS_STARTED 4096 N/A WMI_JOB_STATE_RUNNING 4 N/A WMI_JOB_STATE_COMPLETED 7 get_connection N/A N/A _ N/A N/A N/A wmi N/A N/A wmi None N/A N/A wmi N/A __import__ wmi N/A N/A HyperVConnection N/A HyperVConnection N/A N/A driver ComputeDriver N/A __init__ N/A N/A self N/A N/A N/A N/A N/A N/A super HyperVConnection self __init__ N/A N/A self _conn N/A N/A wmi WMI moniker //./root/virtualization N/A N/A self _cim_conn N/A N/A wmi WMI moniker //./root/cimv2 N/A init_host N/A N/A self host N/A N/A N/A N/A N/A LOG debug N/A _ In init host N/A N/A list_instances N/A N/A self N/A N/A N/A  Return the names of all the instances known to Hyper-V.  N/A vms N/A N/A v ElementName N/A v N/A N/A N/A self _conn Msvm_ComputerSystem N/A ElementName N/A vms N/A list_instances_detail N/A N/A self N/A N/A N/A instance_infos N/A N/A instance_name N/A N/A self list_instances N/A N/A info N/A N/A self get_info instance_name N/A state N/A info N/A state N/A instance_info N/A N/A driver InstanceInfo instance_name state N/A N/A N/A instance_infos append instance_info N/A instance_infos N/A spawn N/A N/A self context instance network_info block_device_info N/A None None N/A N/A  Create a new VM and start it. N/A vm N/A N/A self _lookup N/A instance name N/A N/A vm None N/A N/A N/A N/A exception InstanceExists name N/A instance name N/A base_vhd_filename N/A N/A N/A os path join N/A FLAGS instances_path N/A instance name N/A vhdfile N/A %s.vhd base_vhd_filename N/A N/A N/A images fetch N/A instance N/A image_ref vhdfile N/A instance N/A user_id N/A instance N/A project_id N/A N/A N/A N/A N/A self _create_vm instance N/A N/A N/A self _create_disk N/A instance N/A name vhdfile N/A mac_address None N/A N/A instance N/A mac_addresses N/A N/A mac_address N/A N/A N/A instance N/A mac_addresses N/A 0 N/A address N/A N/A N/A self _create_nic N/A instance N/A name mac_address N/A N/A N/A LOG debug N/A _ Starting VM %s  N/A instance name N/A N/A N/A self _set_vm_state N/A instance N/A name Enabled N/A N/A N/A LOG info N/A _ Started VM %s  N/A instance name N/A N/A N/A Exception N/A exn N/A N/A N/A N/A LOG exception N/A _ spawn vm failed: %s exn N/A N/A N/A self destroy instance N/A _create_vm N/A N/A self instance N/A N/A N/A Create a VM but don't start it.   N/A vs_man_svc N/A N/A N/A N/A self _conn Msvm_VirtualSystemManagementService N/A 0 N/A vs_gs_data N/A N/A N/A N/A self _conn Msvm_VirtualSystemGlobalSettingData new N/A N/A vs_gs_data ElementName N/A instance N/A name N/A N/A job ret_val N/A N/A N/A vs_man_svc DefineVirtualSystem N/A None N/A N/A vs_gs_data GetText_ 1 N/A 1 N/A N/A ret_val WMI_JOB_STATUS_STARTED N/A N/A success N/A N/A self _check_job_status job N/A N/A success N/A ret_val 0 N/A N/A success N/A N/A N/A Exception N/A _ Failed to create VM %s N/A instance name N/A N/A N/A LOG debug N/A _ Created VM %s... N/A instance name N/A vm N/A N/A N/A N/A self _conn Msvm_ComputerSystem ElementName N/A instance name N/A 0 N/A vmsettings N/A N/A vm associators wmi_result_class Msvm_VirtualSystemSettingData N/A vmsetting N/A N/A s N/A s vmsettings N/A N/A s SettingType 3 N/A 0 N/A memsetting N/A N/A N/A vmsetting associators wmi_result_class Msvm_MemorySettingData N/A 0 N/A mem N/A long N/A str N/A instance N/A memory_mb N/A N/A memsetting VirtualQuantity mem N/A N/A memsetting Reservation mem N/A N/A memsetting Limit mem N/A N/A job ret_val N/A N/A vs_man_svc ModifyVirtualSystemResources N/A N/A vm path_ N/A N/A N/A memsetting GetText_ 1 N/A N/A N/A LOG debug N/A _ Set memory for vm %s... N/A instance name N/A procsetting N/A N/A N/A vmsetting associators wmi_result_class Msvm_ProcessorSettingData N/A 0 N/A vcpus N/A long N/A instance N/A vcpus N/A N/A procsetting VirtualQuantity vcpus N/A N/A procsetting Reservation vcpus N/A N/A procsetting Limit 100000 N/A N/A job ret_val N/A N/A vs_man_svc ModifyVirtualSystemResources N/A N/A vm path_ N/A N/A N/A procsetting GetText_ 1 N/A N/A N/A LOG debug N/A _ Set vcpus for vm %s... N/A instance name N/A _create_disk N/A N/A self vm_name vhdfile N/A N/A N/A Create a disk and attach it to the vm N/A N/A N/A LOG debug N/A N/A _ Creating disk for %(vm_name)s by attaching disk file %(vhdfile)s N/A locals N/A vms N/A N/A N/A self _conn MSVM_ComputerSystem ElementName vm_name N/A vm N/A vms N/A 0 N/A vmsettings N/A N/A vm associators wmi_result_class Msvm_VirtualSystemSettingData N/A rasds N/A N/A N/A vmsettings N/A 0 associators wmi_result_class MSVM_ResourceAllocationSettingData N/A ctrller N/A r N/A r rasds N/A N/A N/A r ResourceSubType Microsoft Emulated IDE Controller N/A N/A r Address 0 N/A diskdflt N/A N/A N/A N/A self _conn query SELECT * FROM Msvm_ResourceAllocationSettingData                 WHERE ResourceSubType LIKE 'Microsoft Synthetic Disk Drive'                AND InstanceID LIKE '%Default%' N/A 0 N/A diskdrive N/A N/A self _clone_wmi_obj Msvm_ResourceAllocationSettingData diskdflt N/A N/A diskdrive Parent N/A N/A N/A ctrller N/A 0 path_ N/A N/A diskdrive Address 0 N/A new_resources N/A N/A self _add_virt_resource diskdrive vm N/A N/A new_resources None N/A N/A N/A Exception N/A _ Failed to add diskdrive to VM %s vm_name N/A diskdrive_path N/A new_resources N/A 0 N/A N/A N/A LOG debug N/A _ New disk drive path is %s diskdrive_path N/A vhddefault N/A N/A N/A N/A self _conn query SELECT * FROM Msvm_ResourceAllocationSettingData                  WHERE ResourceSubType LIKE 'Microsoft Virtual Hard Disk' AND                  InstanceID LIKE '%Default%'  N/A 0 N/A vhddisk N/A N/A self _clone_wmi_obj Msvm_ResourceAllocationSettingData vhddefault N/A N/A vhddisk Parent diskdrive_path N/A N/A vhddisk Connection N/A vhdfile N/A new_resources N/A N/A self _add_virt_resource vhddisk vm N/A N/A new_resources None N/A N/A N/A Exception N/A _ Failed to add vhd file to VM %s vm_name N/A N/A N/A LOG info N/A _ Created disk for %s vm_name N/A _create_nic N/A N/A self vm_name mac N/A N/A N/A Create a (emulated) nic and attach it to the vm N/A N/A N/A LOG debug N/A _ Creating nic for %s  vm_name N/A vms N/A N/A N/A self _conn Msvm_ComputerSystem ElementName vm_name N/A extswitch N/A N/A self _find_external_network N/A vm N/A vms N/A 0 N/A switch_svc N/A N/A N/A N/A self _conn Msvm_VirtualSwitchManagementService N/A 0 N/A emulatednics_data N/A N/A N/A self _conn Msvm_EmulatedEthernetPortSettingData N/A default_nic_data N/A n N/A n emulatednics_data N/A N/A N/A N/A n InstanceID rfind Default 0 N/A new_nic_data N/A N/A self _clone_wmi_obj Msvm_EmulatedEthernetPortSettingData N/A default_nic_data N/A 0 N/A N/A new_port ret_val N/A N/A switch_svc CreateSwitchPort vm_name vm_name N/A N/A extswitch path_ N/A N/A ret_val 0 N/A N/A N/A N/A LOG error N/A _ Failed creating a port on the external vswitch N/A N/A Exception N/A _ Failed creating port for %s vm_name N/A ext_path N/A N/A extswitch path_ N/A N/A N/A LOG debug N/A N/A _ Created switch port %(vm_name)s on switch %(ext_path)s N/A locals N/A N/A new_nic_data Connection N/A new_port N/A N/A new_nic_data ElementName N/A vm_name  nic N/A N/A new_nic_data Address N/A N/A join N/A N/A mac split : N/A N/A new_nic_data StaticMacAddress TRUE N/A new_resources N/A N/A self _add_virt_resource new_nic_data vm N/A N/A new_resources None N/A N/A N/A Exception N/A _ Failed to add nic to VM %s vm_name N/A N/A N/A LOG info N/A _ Created nic for %s  vm_name N/A _add_virt_resource N/A N/A self res_setting_data target_vm N/A N/A N/A Add a new resource (disk/nic) to the VM N/A vs_man_svc N/A N/A N/A N/A self _conn Msvm_VirtualSystemManagementService N/A 0 N/A N/A job new_resources ret_val N/A N/A vs_man_svc AddVirtualSystemResources N/A N/A N/A res_setting_data GetText_ 1 N/A N/A target_vm path_ N/A success True N/A N/A ret_val WMI_JOB_STATUS_STARTED N/A N/A success N/A N/A self _check_job_status job N/A N/A success N/A ret_val 0 N/A success N/A N/A new_resources N/A N/A None N/A _check_job_status N/A N/A self jobpath N/A N/A N/A Poll WMI job state for completion N/A inst_id N/A N/A N/A N/A N/A jobpath split = N/A 1 strip " N/A jobs N/A N/A N/A self _conn Msvm_ConcreteJob InstanceID inst_id N/A N/A N/A len jobs 0 N/A N/A False N/A job N/A jobs N/A 0 N/A N/A N/A job JobState WMI_JOB_STATE_RUNNING N/A N/A N/A N/A time sleep 0.1 N/A job N/A N/A N/A N/A self _conn Msvm_ConcreteJob InstanceID inst_id N/A 0 N/A N/A N/A job JobState WMI_JOB_STATE_COMPLETED N/A N/A N/A N/A LOG debug N/A _ WMI job failed: %s N/A job ErrorSummaryDescription N/A False N/A desc N/A job Description N/A elap N/A job ElapsedTime N/A N/A N/A LOG debug N/A N/A _ WMI job succeeded: %(desc)s, Elapsed=%(elap)s  N/A locals N/A True N/A _find_external_network N/A N/A self N/A N/A N/A Find the vswitch that is connected to the physical nic.
           Assumes only one physical nic on the host
         N/A bound N/A N/A N/A self _conn Msvm_ExternalEthernetPort IsBound TRUE N/A N/A N/A len bound 0 N/A N/A None N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A self _conn Msvm_ExternalEthernetPort IsBound TRUE N/A 0 associators wmi_result_class Msvm_SwitchLANEndpoint N/A 0 associators wmi_result_class Msvm_SwitchPort N/A 0 associators wmi_result_class Msvm_VirtualSwitch N/A 0 N/A _clone_wmi_obj N/A N/A self wmi_class wmi_obj N/A N/A N/A Clone a WMI object N/A cl N/A N/A N/A self _conn __getattr__ wmi_class N/A newinst N/A N/A cl new N/A prop N/A wmi_obj _properties N/A N/A N/A N/A N/A N/A newinst Properties_ Item prop Value N/A N/A N/A N/A wmi_obj Properties_ Item prop Value N/A newinst N/A reboot N/A N/A self instance network_info N/A N/A N/A Reboot the specified instance. N/A vm N/A N/A self _lookup N/A instance name N/A N/A vm None N/A N/A N/A N/A exception InstanceNotFound instance_id N/A instance id N/A N/A N/A self _set_vm_state N/A instance name Reboot N/A destroy N/A N/A self instance network_info cleanup N/A True N/A N/A Destroy the VM. Also destroy the associated VHD disk files N/A N/A N/A LOG debug N/A _ Got request to destroy vm %s N/A instance name N/A vm N/A N/A self _lookup N/A instance name N/A N/A vm None N/A N/A N/A vm N/A N/A N/A N/A self _conn Msvm_ComputerSystem ElementName N/A instance name N/A 0 N/A vs_man_svc N/A N/A N/A N/A self _conn Msvm_VirtualSystemManagementService N/A 0 N/A N/A N/A self _set_vm_state N/A instance name Disabled N/A vmsettings N/A N/A vm associators wmi_result_class Msvm_VirtualSystemSettingData N/A rasds N/A N/A N/A vmsettings N/A 0 associators wmi_result_class MSVM_ResourceAllocationSettingData N/A disks N/A r N/A r rasds N/A N/A r ResourceSubType Microsoft Virtual Hard Disk N/A diskfiles N/A N/A disk disks N/A N/A N/A N/A diskfiles extend N/A c N/A c N/A disk Connection N/A N/A job ret_val N/A N/A vs_man_svc DestroyVirtualSystem N/A N/A vm path_ N/A N/A ret_val WMI_JOB_STATUS_STARTED N/A N/A success N/A N/A self _check_job_status job N/A N/A N/A ret_val 0 N/A N/A success True N/A N/A success N/A N/A N/A Exception N/A N/A _ Failed to destroy vm %s N/A instance name N/A disk diskfiles N/A N/A vhdfile N/A N/A N/A self _cim_conn CIM_DataFile Name disk N/A vf vhdfile N/A N/A N/A N/A vf Delete N/A instance_name N/A instance name N/A N/A N/A LOG debug N/A N/A _ Del: disk %(vhdfile)s vm %(instance_name)s N/A locals N/A get_info N/A N/A self instance_id N/A N/A N/A Get information about the VM N/A vm N/A N/A self _lookup instance_id N/A N/A vm None N/A N/A N/A N/A exception InstanceNotFound instance_id instance_id N/A vm N/A N/A N/A N/A self _conn Msvm_ComputerSystem ElementName instance_id N/A 0 N/A vs_man_svc N/A N/A N/A N/A self _conn Msvm_VirtualSystemManagementService N/A 0 N/A vmsettings N/A N/A vm associators wmi_result_class Msvm_VirtualSystemSettingData N/A settings_paths N/A N/A N/A v path_ N/A v vmsettings N/A summary_info N/A N/A N/A vs_man_svc GetSummaryInformation N/A 4 100 103 105 settings_paths N/A 1 N/A info N/A summary_info N/A 0 N/A state N/A str N/A HYPERV_POWER_STATE N/A N/A info EnabledState N/A memusage N/A str N/A info MemoryUsage N/A numprocs N/A str N/A info NumberOfProcessors N/A uptime N/A str N/A info UpTime N/A N/A N/A LOG debug N/A N/A _ Got Info for vm %(instance_id)s: state=%(state)s, mem=%(memusage)s, num_cpu=%(numprocs)s, cpu_time=%(uptime)s N/A locals N/A N/A state max_mem mem num_cpu cpu_time N/A HYPERV_POWER_STATE N/A N/A info EnabledState N/A info MemoryUsage N/A info MemoryUsage N/A info NumberOfProcessors N/A info UpTime N/A _lookup N/A N/A self i N/A N/A N/A vms N/A N/A N/A self _conn Msvm_ComputerSystem ElementName i N/A n N/A len vms N/A N/A n 0 N/A N/A None N/A N/A N/A n 1 N/A N/A N/A Exception N/A N/A _ duplicate name found: %s i N/A N/A N/A N/A vms N/A 0 ElementName N/A _set_vm_state N/A N/A self vm_name req_state N/A N/A N/A Set the desired state of the VM N/A vms N/A N/A N/A self _conn Msvm_ComputerSystem ElementName vm_name N/A N/A N/A len vms 0 N/A N/A False N/A N/A job ret_val N/A N/A N/A vms N/A 0 RequestStateChange N/A REQ_POWER_STATE N/A req_state N/A success False N/A N/A ret_val WMI_JOB_STATUS_STARTED N/A N/A success N/A N/A self _check_job_status job N/A N/A N/A ret_val 0 N/A N/A success True N/A N/A N/A ret_val 32775 N/A N/A success True N/A success N/A N/A N/A N/A LOG info N/A N/A _ Successfully changed vm state of %(vm_name)s to %(req_state)s N/A locals N/A N/A msg N/A N/A _ Failed to change vm state of %(vm_name)s to %(req_state)s N/A locals N/A N/A N/A LOG error msg N/A N/A Exception msg N/A attach_volume N/A N/A self instance_name device_path mountpoint N/A N/A N/A vm N/A N/A self _lookup instance_name N/A N/A vm None N/A N/A N/A N/A exception InstanceNotFound instance_id instance_name N/A detach_volume N/A N/A self instance_name mountpoint N/A N/A N/A vm N/A N/A self _lookup instance_name N/A N/A vm None N/A N/A N/A N/A exception InstanceNotFound instance_id instance_name N/A poll_rescued_instances N/A N/A self timeout N/A N/A N/A N/A update_available_resource N/A N/A self ctxt host N/A N/A N/A This method is supported only by libvirt. N/A N/A update_host_status N/A N/A self N/A N/A N/A See xenapi_conn.py implementation. N/A N/A get_host_stats N/A N/A self refresh N/A False N/A N/A See xenapi_conn.py implementation. N/A N/A host_power_action N/A N/A self host action N/A N/A N/A Reboots, shuts down or powers up the host. N/A N/A set_host_enabled N/A N/A self host enabled N/A N/A N/A Sets the specified host's ability to accept new instances. N/A N/A N/A