saltext.vmware.modules.vmc_vm_disks#

Salt execution module for VMC vm disks Provides methods to Create, Read, Update and Delete virtual disks from the VM.

saltext.vmware.modules.vmc_vm_disks.list_(hostname, username, password, vm_id, verify_ssl=True, cert=None)[source]#

Retrieves the available virtual disks for given VM.

CLI Example:

salt vm_minion vmc_vm_disks.list hostname=sample-vcenter.vmwarevmc.com ...
hostname

Hostname of the vCenter console

username

username required to login to vCenter console

password

password required to login to vCenter console

vm_id

Virtual machine identifier for which the available hard disks should be retrieved.

verify_ssl

(optional) Option to enable/disable SSL verification. Enabled by default. If set to False, the certificate validation is skipped.

cert

(optional) Path to the SSL client certificate file to connect to VMC Cloud Console. The certificate can be retrieved from browser.

saltext.vmware.modules.vmc_vm_disks.get(hostname, username, password, vm_id, disk_id, verify_ssl=True, cert=None)[source]#

Retrieves details of given virtual disk for given VM.

CLI Example:

salt vm_minion vmc_vm_disks.get hostname=sample-vcenter.vmwarevmc.com ...
hostname

Hostname of the vCenter console

username

username required to login to vCenter console

password

password required to login to vCenter console

vm_id

Virtual machine identifier for which the disk details should be retrieved.

disk_id

Virtual disk identifier for which the details should be retrieved from given VM

verify_ssl

(optional) Option to enable/disable SSL verification. Enabled by default. If set to False, the certificate validation is skipped.

cert

(optional) Path to the SSL client certificate file to connect to VMC Cloud Console. The certificate can be retrieved from browser.

saltext.vmware.modules.vmc_vm_disks.delete(hostname, username, password, vm_id, disk_id, verify_ssl=True, cert=None)[source]#

Deletes given virtual disk from given VM.

CLI Example:

salt vm_minion vmc_vm_disks.delete hostname=sample-vcenter.vmwarevmc.com ...
hostname

Hostname of the vCenter console

username

username required to login to vCenter console

password

password required to login to vCenter console

vm_id

Virtual machine identifier for which the disk should be removed.

disk_id

Virtual disk identifier which has to be removed from given VM

verify_ssl

(optional) Option to enable/disable SSL verification. Enabled by default. If set to False, the certificate validation is skipped.

cert

(optional) Path to the SSL client certificate file to connect to VMC Cloud Console. The certificate can be retrieved from browser.

saltext.vmware.modules.vmc_vm_disks.update(hostname, username, password, vm_id, disk_id, verify_ssl=True, cert=None, backing_type=None, vmdk_file=None)[source]#

Updates the configuration of a given virtual disk of given VM. An update operation can be used to detach the existing VMDK file and attach another VMDK file to the virtual machine.

CLI Example:

salt vm_minion vmc_vm_disks.update hostname=sample-vcenter.vmwarevmc.com ...
hostname

Hostname of the vCenter console

username

username required to login to vCenter console

password

password required to login to vCenter console

vm_id

Virtual machine identifier for which the disk should be added.

disk_id

Virtual disk identifier which has to be updated for given VM

verify_ssl

(optional) Option to enable/disable SSL verification. Enabled by default. If set to False, the certificate validation is skipped.

cert

(optional) Path to the SSL client certificate file to connect to VMC Cloud Console. The certificate can be retrieved from browser.

backing_type

(mandatory) Backing type for the virtual disk. Possible values are: VMDK_FILE

vmdk_file

(mandatory) Path of the VMDK file backing the virtual disk.

saltext.vmware.modules.vmc_vm_disks.create(hostname, username, password, vm_id, bus_adapter_type, verify_ssl=True, cert=None, vmdk=None, capacity=None, storage_policy_id=None, scsi=None, sata=None, ide=None)[source]#

Creates virtual disk for given VM.

CLI Example:

salt vm_minion vmc_vm_disks.create hostname=sample-vcenter.vmwarevmc.com ...
hostname

Hostname of the vCenter console

username

username required to login to vCenter console

password

password required to login to vCenter console

vm_id

Virtual machine identifier for which the disk should be added.

bus_adapter_type

Type of host bus adapter to which the disk should be attached. Possible values are: IDE, SATA, SCSI

verify_ssl

(optional) Option to enable/disable SSL verification. Enabled by default. If set to False, the certificate validation is skipped.

cert

(optional) Path to the SSL client certificate file to connect to VMC Cloud Console. The certificate can be retrieved from browser.

vmdk

(optional) If empty, None, or a string create a new VMDK. If empty or None, creates new VMDK with a name (derived from the name of the virtual machine) chosen by the server. If vmdk ends with .vmdk, it must refer to an existing VMDK. Otherwise, vmdk will be the stem of the new VMDK. Example vmdk="test-vm-1" will result in [WorkloadDatastore] 8dff8760-b6da-24d2-475b-0200a629f7fc/test-vm-1.vmdk.

capacity

(Optional) The capacity for the disk, in bytes. If unset, defaults to a guest-specific capacity. Prohibited if the vmdk ends with .vmdk

storage_policy_id

(Optional) The identifier for the storage policy to be used when creating the vmdk file. Prohibited if the vmdk ends with .vmdk

scsi

(optional) Address for attaching the device to a virtual SCSI adapter. If unset, the server will choose an available address; if none is available, the request will fail.

It is a json object which can contain ‘bus’ and ‘unit’ keys.

‘bus’: (Integer As Int64) (mandatory)

Bus number of the adapter to which the device should be attached.

‘unit’: (Integer As Int64) (optional)

Unit number of the device. If unset, the server will choose an available unit number on the specified adapter. If there are no available connections on the adapter, the request will be rejected.

For ex:

"scsi": {
    "bus": 0,
    "unit": 1
}
sata

(optional) Address for attaching the device to a virtual SATA adapter. If unset, the server will choose an available address; if none is available, the request will fail.

It is a json object which can contain ‘bus’ and ‘unit’ keys.

‘bus’: (Integer As Int64) (mandatory)

Bus number of the adapter to which the device should be attached.

‘unit’: (Integer As Int64) (optional)

Unit number of the device. If unset, the server will choose an available unit number on the specified adapter. If there are no available connections on the adapter, the request will be rejected.

For ex:

"sata": {
    "bus": 0,
    "unit": 1
}
ide

(optional) Address for attaching the device to a virtual IDE adapter. If unset, the server will choose an available address; if none is available, the request will fail.

It is a json object which can contain ‘master’ and ‘primary’ keys.

‘master’: (Boolean) (Optional)

Flag specifying whether the device should be the master or slave device on the IDE adapter. If unset, the server will choose an available connection type. If no IDE connections are available, the request will be rejected.

‘primary’: (Boolean) (Optional)

Flag specifying whether the device should be attached to the primary or secondary IDE adapter of the virtual machine. If unset, the server will choose a adapter with an available connection. If no IDE connections are available, the request will be rejected.

For ex:

"ide": {
    "master": false,
    "primary": false
}