Skip to main content

datacenter_vms

Creates, updates, deletes, gets or lists a datacenter_vms resource.

Overview​

Namedatacenter_vms
TypeResource
Idovh.dedicated_cloud.datacenter_vms

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
namestringName of the virtual machine.
vm_idintegerId of the virtual machine. (wire: vmId)
cluster_namestringCluster of the virtual machine. (wire: clusterName)
folder_namestringFolder of the virtual machine. (wire: folderName)
host_namestringName of the host hosting the virtual machine. (wire: hostName)
backupobjectBackup associated to this Virtual Machine
cdromsarrayVirtual machine cdroms devices
cpu_maxnumberMaximum CPU performance, in MHz. (wire: cpuMax)
cpu_numintegerNumber of processors in the virtual machine. (wire: cpuNum)
cpu_readynumberTime that the virtual machine was ready, but could not get scheduled to run on the physical CPU. In millisecond (wire: cpuReady)
cpu_ready_percentnumberPercentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU. In percent (wire: cpuReadyPercent)
cpu_usedintegerCurrent CPU performance, in MHz. (wire: cpuUsed)
filersarrayList of filers in use by the virtual machine.
guest_os_familystringVMware guest configured OS family (wire: guestOsFamily)
licensestringRegistered managed license (OVHcloud managed, unknown or unsupported license, unlicensed windows guestos, windows 2008 R2 Datacenter, windows 2008 R2 Enterprise, windows 2008 R2 Standard, windows 2008 R2 Web, windows 2012 Datacenter, windows 2012 R2 Datacenter, windows 2012 R2 Standard, windows 2012 R2 Standard SQL2016 Standard, windows 2012 R2 Standard SQL2016 Web, windows 2012 Standard, windows 2016 Datacenter, windows 2016 Standard, windows 2016 Standard SQL2016 Standard, windows 2016 Standard SQL2016 Web, windows 2019 Datacenter, windows 2019 Datacenter Core, windows 2019 Standard, windows 2019 Standard Core, windows 2019 Standard SQL2019 Standard, windows 2019 Standard SQL2019 Web, windows 2019 Standard SQL2022 Standard, windows 2019 Standard SQL2022 Web, windows 2022 Datacenter, windows 2022 Datacenter Core, windows 2022 Datacenter SQL2019 Standard, windows 2022 Datacenter SQL2019 Web, windows 2022 Datacenter SQL2022 Standard, windows 2022 Datacenter SQL2022 Web, windows 2022 Standard, windows 2022 Standard Core, windows 2022 Standard SQL2019 Standard, windows 2022 Standard SQL2019 Web, windows 2022 Standard SQL2022 Standard, windows 2022 Standard SQL2022 Web, windows 2025 Datacenter, windows 2025 Datacenter Core, windows 2025 Datacenter SQL2022 Enterprise, windows 2025 Datacenter SQL2022 Standard, windows 2025 Datacenter SQL2022 Web, windows 2025 Standard, windows 2025 Standard Core, windows 2025 Standard SQL2022 Standard, windows 2025 Standard SQL2022 Web)
memory_maxintegerMemory size of the virtual machine, in MB (wire: memoryMax)
memory_tpsstringAmount of guest memory that is shared with other virtual machines, in Mb (wire: memoryTps)
memory_usedintegerCurrent memory utilization, in MB (wire: memoryUsed)
mo_refstringmoRef of the virtual machine. (wire: moRef)
net_packet_rxnumberNumber of packets received. (wire: netPacketRx)
net_packet_txnumberNumber of packets transmitted. (wire: netPacketTx)
net_rxnumberRate at which data is received. In KB/s (wire: netRx)
net_txnumberRate at which data is transmitted. In KB/s (wire: netTx)
networksarrayList of the networks link to this virtual machine
power_statestringPower state of the virtual machine. (deleted, poweredOff, poweredOn, suspended) (wire: powerState)
read_latencynumberAmount of time for a read operation from the virtual disk. In millisecond (wire: readLatency)
read_per_secondnumberNumber of read issued per second to the virtual disk. In millisecond (wire: readPerSecond)
read_ratenumberRate of reading data from the virtual disk. In KB/s (wire: readRate)
role_ftstringThe index of the current VM in instanceUuids array starting from 1, so 1 means that it is the primary VM. (wire: roleFt)
snapshot_numintegerNumber of snapshot of the virtual machine. (wire: snapshotNum)
state_ftstringThe fault tolerance state of the virtual machine. (disabled, enabled, needSecondary, notConfigured, running, starting) (wire: stateFt)
vmware_toolsstringCurrent version status of VMware Tools in the guest operating system. (wire: vmwareTools)
vmware_tools_versionstringCurrent version of VMware Tools (wire: vmwareToolsVersion)
write_latencynumberAmount of time for a write operation from the virtual disk. In millisecond (wire: writeLatency)
write_per_secondnumberNumber of write issued per second to the virtual disk. In millisecond (wire: writePerSecond)
write_ratenumberRate of writing data from the virtual disk. In KB/s (wire: writeRate)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdatacenter_id, service_name, vm_idGet a virtual machine. Returns the virtual machine: power state, host, cluster, CPU, memory, disk and network usage, backup and license.
listselectdatacenter_id, service_namex_pagination_modeList virtual machines
disable_backupexecdatacenterId, serviceName, vmIdDisable VM backup
disable_carpexecdatacenterId, serviceName, vmId, macAddressDisable CARP on a VM. Disables CARP on the network port of the virtual machine with the given MAC address, on the VM Network portgroup. Returns a task to track progress.
edit_backupexecdatacenterId, serviceName, vmId, backupDaysUpdate VM backup days. Changes the days on which the virtual machine is backed up. Returns a task to track progress.
enable_backupexecdatacenterId, serviceName, vmId, backupDaysEnable VM backup. Starts backing up the virtual machine on the given days. Returns a task to track progress.
enable_carpexecdatacenterId, serviceName, vmId, macAddressEnable CARP on a VM. Enables CARP on the network port of the virtual machine with the given MAC address, on the VM Network portgroup. Returns a task to track progress.
remove_licenseexecdatacenterId, serviceName, vmIdRemove a managed license. Removes the managed license from the virtual machine. Returns a task to track progress.
restore_backupexecdatacenterId, serviceName, vmId, filerId, restorePointIdRestore a VM backup. Restores the virtual machine from a restore point to the given datastore, NAS by default or vSAN. Returns a task to track progress.
set_licenseexecdatacenterId, serviceName, vmId, bypassGuestOsFamilyCheck, kmsLicenseSet a managed license. Attaches an OVHcloud managed Windows license to the virtual machine. Skip the guest OS family check with bypassGuestOsFamilyCheck. Returns a task to track progress.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
datacenterIdintegerId of the Datacenter
datacenter_idintegerId of the Datacenter (wire: datacenterId)
serviceNamestringDomain of the service
service_namestringDomain of the service (wire: serviceName)
vmIdintegerId of the virtual machine.
vm_idintegerId of the virtual machine. (wire: vmId)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Get a virtual machine. Returns the virtual machine: power state, host, cluster, CPU, memory, disk and network usage, backup and license.

SELECT
name,
vm_id,
cluster_name,
folder_name,
host_name,
backup,
cdroms,
cpu_max,
cpu_num,
cpu_ready,
cpu_ready_percent,
cpu_used,
filers,
guest_os_family,
license,
memory_max,
memory_tps,
memory_used,
mo_ref,
net_packet_rx,
net_packet_tx,
net_rx,
net_tx,
networks,
power_state,
read_latency,
read_per_second,
read_rate,
role_ft,
snapshot_num,
state_ft,
vmware_tools,
vmware_tools_version,
write_latency,
write_per_second,
write_rate
FROM ovh.dedicated_cloud.datacenter_vms
WHERE datacenter_id = '{{ datacenter_id }}' -- required
AND service_name = '{{ service_name }}' -- required
AND vm_id = '{{ vm_id }}' -- required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Disable VM backup

EXEC ovh.dedicated_cloud.datacenter_vms.disable_backup
@datacenterId='{{ datacenterId }}' --required,
@serviceName='{{ serviceName }}' --required,
@vmId='{{ vmId }}' --required
;