datacenter_vms
Creates, updates, deletes, gets or lists a datacenter_vms resource.
Overview​
| Name | datacenter_vms |
| Type | Resource |
| Id | ovh.dedicated_cloud.datacenter_vms |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the virtual machine. |
vm_id | integer | Id of the virtual machine. (wire: vmId) |
cluster_name | string | Cluster of the virtual machine. (wire: clusterName) |
folder_name | string | Folder of the virtual machine. (wire: folderName) |
host_name | string | Name of the host hosting the virtual machine. (wire: hostName) |
backup | object | Backup associated to this Virtual Machine |
cdroms | array | Virtual machine cdroms devices |
cpu_max | number | Maximum CPU performance, in MHz. (wire: cpuMax) |
cpu_num | integer | Number of processors in the virtual machine. (wire: cpuNum) |
cpu_ready | number | Time that the virtual machine was ready, but could not get scheduled to run on the physical CPU. In millisecond (wire: cpuReady) |
cpu_ready_percent | number | Percentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU. In percent (wire: cpuReadyPercent) |
cpu_used | integer | Current CPU performance, in MHz. (wire: cpuUsed) |
filers | array | List of filers in use by the virtual machine. |
guest_os_family | string | VMware guest configured OS family (wire: guestOsFamily) |
license | string | Registered 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_max | integer | Memory size of the virtual machine, in MB (wire: memoryMax) |
memory_tps | string | Amount of guest memory that is shared with other virtual machines, in Mb (wire: memoryTps) |
memory_used | integer | Current memory utilization, in MB (wire: memoryUsed) |
mo_ref | string | moRef of the virtual machine. (wire: moRef) |
net_packet_rx | number | Number of packets received. (wire: netPacketRx) |
net_packet_tx | number | Number of packets transmitted. (wire: netPacketTx) |
net_rx | number | Rate at which data is received. In KB/s (wire: netRx) |
net_tx | number | Rate at which data is transmitted. In KB/s (wire: netTx) |
networks | array | List of the networks link to this virtual machine |
power_state | string | Power state of the virtual machine. (deleted, poweredOff, poweredOn, suspended) (wire: powerState) |
read_latency | number | Amount of time for a read operation from the virtual disk. In millisecond (wire: readLatency) |
read_per_second | number | Number of read issued per second to the virtual disk. In millisecond (wire: readPerSecond) |
read_rate | number | Rate of reading data from the virtual disk. In KB/s (wire: readRate) |
role_ft | string | The index of the current VM in instanceUuids array starting from 1, so 1 means that it is the primary VM. (wire: roleFt) |
snapshot_num | integer | Number of snapshot of the virtual machine. (wire: snapshotNum) |
state_ft | string | The fault tolerance state of the virtual machine. (disabled, enabled, needSecondary, notConfigured, running, starting) (wire: stateFt) |
vmware_tools | string | Current version status of VMware Tools in the guest operating system. (wire: vmwareTools) |
vmware_tools_version | string | Current version of VMware Tools (wire: vmwareToolsVersion) |
write_latency | number | Amount of time for a write operation from the virtual disk. In millisecond (wire: writeLatency) |
write_per_second | number | Number of write issued per second to the virtual disk. In millisecond (wire: writePerSecond) |
write_rate | number | Rate of writing data from the virtual disk. In KB/s (wire: writeRate) |
Virtual machine
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the virtual machine. |
vm_id | integer | Id of the virtual machine. (wire: vmId) |
cluster_name | string | Cluster of the virtual machine. (wire: clusterName) |
folder_name | string | Folder of the virtual machine. (wire: folderName) |
host_name | string | Name of the host hosting the virtual machine. (wire: hostName) |
backup | object | Backup associated to this Virtual Machine |
cdroms | array | Virtual machine cdroms devices |
cpu_max | number | Maximum CPU performance, in MHz. (wire: cpuMax) |
cpu_num | integer | Number of processors in the virtual machine. (wire: cpuNum) |
cpu_ready | number | Time that the virtual machine was ready, but could not get scheduled to run on the physical CPU. In millisecond (wire: cpuReady) |
cpu_ready_percent | number | Percentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU. In percent (wire: cpuReadyPercent) |
cpu_used | integer | Current CPU performance, in MHz. (wire: cpuUsed) |
filers | array | List of filers in use by the virtual machine. |
guest_os_family | string | VMware guest configured OS family (wire: guestOsFamily) |
license | string | Registered 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_max | integer | Memory size of the virtual machine, in MB (wire: memoryMax) |
memory_tps | string | Amount of guest memory that is shared with other virtual machines, in Mb (wire: memoryTps) |
memory_used | integer | Current memory utilization, in MB (wire: memoryUsed) |
mo_ref | string | moRef of the virtual machine. (wire: moRef) |
net_packet_rx | number | Number of packets received. (wire: netPacketRx) |
net_packet_tx | number | Number of packets transmitted. (wire: netPacketTx) |
net_rx | number | Rate at which data is received. In KB/s (wire: netRx) |
net_tx | number | Rate at which data is transmitted. In KB/s (wire: netTx) |
networks | array | List of the networks link to this virtual machine |
power_state | string | Power state of the virtual machine. (deleted, poweredOff, poweredOn, suspended) (wire: powerState) |
read_latency | number | Amount of time for a read operation from the virtual disk. In millisecond (wire: readLatency) |
read_per_second | number | Number of read issued per second to the virtual disk. In millisecond (wire: readPerSecond) |
read_rate | number | Rate of reading data from the virtual disk. In KB/s (wire: readRate) |
role_ft | string | The index of the current VM in instanceUuids array starting from 1, so 1 means that it is the primary VM. (wire: roleFt) |
snapshot_num | integer | Number of snapshot of the virtual machine. (wire: snapshotNum) |
state_ft | string | The fault tolerance state of the virtual machine. (disabled, enabled, needSecondary, notConfigured, running, starting) (wire: stateFt) |
vmware_tools | string | Current version status of VMware Tools in the guest operating system. (wire: vmwareTools) |
vmware_tools_version | string | Current version of VMware Tools (wire: vmwareToolsVersion) |
write_latency | number | Amount of time for a write operation from the virtual disk. In millisecond (wire: writeLatency) |
write_per_second | number | Number of write issued per second to the virtual disk. In millisecond (wire: writePerSecond) |
write_rate | number | Rate of writing data from the virtual disk. In KB/s (wire: writeRate) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | datacenter_id, service_name, vm_id | Get a virtual machine. Returns the virtual machine: power state, host, cluster, CPU, memory, disk and network usage, backup and license. | |
list | select | datacenter_id, service_name | x_pagination_mode | List virtual machines |
disable_backup | exec | datacenterId, serviceName, vmId | Disable VM backup | |
disable_carp | exec | datacenterId, serviceName, vmId, macAddress | Disable 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_backup | exec | datacenterId, serviceName, vmId, backupDays | Update VM backup days. Changes the days on which the virtual machine is backed up. Returns a task to track progress. | |
enable_backup | exec | datacenterId, serviceName, vmId, backupDays | Enable VM backup. Starts backing up the virtual machine on the given days. Returns a task to track progress. | |
enable_carp | exec | datacenterId, serviceName, vmId, macAddress | Enable 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_license | exec | datacenterId, serviceName, vmId | Remove a managed license. Removes the managed license from the virtual machine. Returns a task to track progress. | |
restore_backup | exec | datacenterId, serviceName, vmId, filerId, restorePointId | Restore 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_license | exec | datacenterId, serviceName, vmId, bypassGuestOsFamilyCheck, kmsLicense | Set 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.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The 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"}}) |
datacenterId | integer | Id of the Datacenter |
datacenter_id | integer | Id of the Datacenter (wire: datacenterId) |
serviceName | string | Domain of the service |
service_name | string | Domain of the service (wire: serviceName) |
vmId | integer | Id of the virtual machine. |
vm_id | integer | Id of the virtual machine. (wire: vmId) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
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
;
List virtual machines
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 x_pagination_mode = '{{ x_pagination_mode }}'
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- disable_backup
- disable_carp
- edit_backup
- enable_backup
- enable_carp
- remove_license
- restore_backup
- set_license
Disable VM backup
EXEC ovh.dedicated_cloud.datacenter_vms.disable_backup
@datacenterId='{{ datacenterId }}' --required,
@serviceName='{{ serviceName }}' --required,
@vmId='{{ vmId }}' --required
;
Disable 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.
EXEC ovh.dedicated_cloud.datacenter_vms.disable_carp
@datacenterId='{{ datacenterId }}' --required,
@serviceName='{{ serviceName }}' --required,
@vmId='{{ vmId }}' --required
@@json=
'{
"macAddress": "{{ macAddress }}"
}'
;
Update VM backup days. Changes the days on which the virtual machine is backed up. Returns a task to track progress.
EXEC ovh.dedicated_cloud.datacenter_vms.edit_backup
@datacenterId='{{ datacenterId }}' --required,
@serviceName='{{ serviceName }}' --required,
@vmId='{{ vmId }}' --required
@@json=
'{
"backupDays": "{{ backupDays }}"
}'
;
Enable VM backup. Starts backing up the virtual machine on the given days. Returns a task to track progress.
EXEC ovh.dedicated_cloud.datacenter_vms.enable_backup
@datacenterId='{{ datacenterId }}' --required,
@serviceName='{{ serviceName }}' --required,
@vmId='{{ vmId }}' --required
@@json=
'{
"backupDays": "{{ backupDays }}"
}'
;
Enable 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.
EXEC ovh.dedicated_cloud.datacenter_vms.enable_carp
@datacenterId='{{ datacenterId }}' --required,
@serviceName='{{ serviceName }}' --required,
@vmId='{{ vmId }}' --required
@@json=
'{
"macAddress": "{{ macAddress }}"
}'
;
Remove a managed license. Removes the managed license from the virtual machine. Returns a task to track progress.
EXEC ovh.dedicated_cloud.datacenter_vms.remove_license
@datacenterId='{{ datacenterId }}' --required,
@serviceName='{{ serviceName }}' --required,
@vmId='{{ vmId }}' --required
;
Restore 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.
EXEC ovh.dedicated_cloud.datacenter_vms.restore_backup
@datacenterId='{{ datacenterId }}' --required,
@serviceName='{{ serviceName }}' --required,
@vmId='{{ vmId }}' --required
@@json=
'{
"filerId": {{ filerId }},
"filerType": "{{ filerType }}",
"restorePointId": {{ restorePointId }}
}'
;
Set 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.
EXEC ovh.dedicated_cloud.datacenter_vms.set_license
@datacenterId='{{ datacenterId }}' --required,
@serviceName='{{ serviceName }}' --required,
@vmId='{{ vmId }}' --required
@@json=
'{
"bypassGuestOsFamilyCheck": {{ bypassGuestOsFamilyCheck }},
"kmsLicense": "{{ kmsLicense }}"
}'
;