The VMware API VM utility module to build SOAP object specs.
Bases: object
Bases: object
Bases: tuple
VmdkInfo(path, adapter_type, disk_type, capacity_in_bytes, device)
Alias for field number 1
Alias for field number 3
Alias for field number 4
Alias for field number 2
Alias for field number 0
This function inspects the current set of hardware devices and returns controller_key and unit_number that can be used for attaching a new virtual disk to adapter with the given adapter_type.
Builds the VM clone spec.
Converts standard VIF_MODEL types to the internal VMware ones.
Copy a sparse virtual disk to a thin virtual disk.
This is also done to generate the meta-data file whose specifics depend on the size of the disk, thin/thick provisioning and the storage adapter type.
Parameters: |
|
---|---|
Returns: | None |
Builds a Config Spec for the LSI or Bus Logic Controller’s addition which acts as the controller for the virtual hard disk to be attached to the VM.
Creates a folder in vCenter
A folder of ‘name’ will be created under the parent folder. The moref of the folder is returned.
Creates config spec for serial port.
Builds spec for the creation of a new Virtual CDROM to the VM.
Create VM on ESX host.
Destroy a VM instance. Assumes VM is powered off.
Detach specified devices from VM.
Builds spec for the detach of an already existing Virtual Disk from VM.
Returns the rescue device.
The method will raise an exception if the rescue device does not exist. The resuce device has suffix ‘-rescue.vmdk’. :param hardware_devices: the hardware devices for the instance :param instance: nova.objects.instance.Instance object :return: the rescue disk device object
Builds the virtual switch port group add spec.
Get all the clusters in the vCenter.
Get the first free port index.
Builds and returns the cdrom attach config spec.
Get reference to the vCenter cluster with the specified name.
Get the hostname of the ESXi host currently running an instance.
Get reference to a host within the cluster specified.
Get a MoRef to the ESXi host currently running an instance.
Builds the machine id change config spec.
Builds the vif attach config spec.
Builds the vif detach config spec.
Gets the RDM disk key.
Get the resource pool.
Selects a proper iscsi adapter type from the existing hardware devices
Get the aggregate resource stats of a cluster.
Gets the vm profile spec configured for storage policy.
Returns updated boot settings for the instance.
The boot order for the instance will be changed to have the input device as the boot disk.
Builds the VM Create spec.
Builds extra spec fields from a dictionary.
Get reference to the VM through uuid or vm name.
Provides updates for a VM spec.
Return the adapter type to be used in vmdk descriptor.
Adapter type in vmdk descriptor is same for LSI-SAS, LSILogic & ParaVirtual because Virtual Disk Manager API does not recognize the newer controller types.
Builds the vmdk attach config spec.
Builds the virtual disk create spec.
Builds the vmdk detach config spec.
Returns information for the primary VMDK attached to the given VM.
Builds the vnc config spec.
Return VNC port for an VM or None if there is no available port.
Power off the specified instance.
Power on the specified instance.
Turn a propset list into a dictionary
PropSet is an optional attribute on ObjectContent objects that are returned by the VMware API.
You can read more about these at: | http://pubs.vmware.com/vsphere-51/index.jsp | #com.vmware.wssdk.apiref.doc/ | vmodl.query.PropertyCollector.ObjectContent.html
Parameters: | propset – a property “set” from ObjectContent |
---|---|
Returns: | dictionary representing property set |
Reconfigure a VM according to the config spec.
Builds the VM relocation spec.
Searches VM reference using the identifier.
This method is primarily meant to separate out part of the logic for vm_ref search that could be use directly in the special case of migrating the instance. For querying VM linked to an instance always use get_vm_ref instead.