# Private Cloud › Managed VMware › Managed VMware vSphere › Datacenter › Virtual Machines API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Private Cloud product's sections: https://developers.eu.ovhcloud.com/reference/private-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 7 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/private-cloud/managed-vmware/managed-vmware-vsphere/datacenter/virtual-machines/

OpenAPI v1: https://api.eu.ovhcloud.com/v1/__schemas/developer-hub-navigation/private-cloud/managed-vmware/managed-vmware-vsphere/datacenter/virtual-machines.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/private-cloud/managed-vmware/managed-vmware-vsphere/datacenter/virtual-machines.json?format=openapi3

## Operations

- `GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm` — List virtual machines
- `GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}` — Get a virtual machine
- `GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vmLicensed` — List licensed VMs
- `POST /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/disableCarp` — Disable CARP on a VM
- `POST /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/enableCarp` — Enable CARP on a VM
- `POST /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/removeLicense` — Remove a managed license
- `POST /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/setLicense` — Set a managed license

## List virtual machines

`GET /v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm`

Link: https://developers.eu.ovhcloud.com/reference/private-cloud/managed-vmware/managed-vmware-vsphere/datacenter/virtual-machines/#get-dedicatedcloud-servicename-datacenter-datacenterid-vm

**Status:** Stable production version  
**IAM actions:** `pccVMware:apiovh:datacenter/vm/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `datacenterId` | path | integer | yes | Id of the Datacenter |
| `serviceName` | path | string | yes | Domain of the service |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | integer[] | successful operation |

```json
[
  0
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm");

print_r($result);
?>
```

## Get a virtual machine

`GET /v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}`

Link: https://developers.eu.ovhcloud.com/reference/private-cloud/managed-vmware/managed-vmware-vsphere/datacenter/virtual-machines/#get-dedicatedcloud-servicename-datacenter-datacenterid-vm-vmid

**Status:** Stable production version  
**IAM actions:** `pccVMware:apiovh:datacenter/vm/get`

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `datacenterId` | path | integer | yes | Id of the Datacenter |
| `serviceName` | path | string | yes | Domain of the service |
| `vmId` | path | integer | yes | Id of the virtual machine. |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dedicatedCloud.Vm | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `backup` | dedicatedCloud.backup.Backup | read-only | Backup associated to this Virtual Machine |
| `backup.allocatedDisk` | number |  | Disk space allocated to the virtual machine (in GB) |
| `backup.backupDays` | dedicatedCloud.backup.BackupDaysEnum[] |  | List of days your Virtual Machine will be backuped |
| `backup.backupRepositoryId` | integer |  | Associated backup repository Id |
| `backup.encryption` | boolean |  | Backup is encrypted |
| `backup.lastCreationTime` | string (date-time) |  | Last creation time of the backup job |
| `backup.lastDuration` | complexType.UnitAndValue_long |  | Last duration of the backup job |
| `backup.lastDuration.unit` | string |  |  |
| `backup.lastDuration.value` | integer |  |  |
| `backup.lastResult` | dedicatedCloud.backup.JobStateEnum |  | Last result of the backup job — one of `failed`, `running`, `stopped`, `stopping`, `success`, `unknown`, `warning` |
| `backup.lastSuccessfulCreationTime` | string (date-time) |  | Last successful creation time of the backup job |
| `backup.lastSuccessfulDuration` | complexType.UnitAndValue_long |  | Last successful duration of the backup job |
| `backup.lastSuccessfulDuration.unit` | string |  |  |
| `backup.lastSuccessfulDuration.value` | integer |  |  |
| `backup.offerType` | dedicatedCloud.backup.OfferTypeEnum |  | Offer type of the backup job — one of `advanced`, `backup`, `classic`, `legacy`, `premium` |
| `backup.restorePoints` | dedicatedCloud.backup.RestorePoint[] |  | Restore points of this backup job |
| `backup.restorePoints[].creationTime` | string (date-time) |  | Creation time of the restore point |
| `backup.restorePoints[].isCorrupted` | boolean |  | Show if the restore point is corrupted |
| `backup.restorePoints[].restorePointId` | integer |  | Id of the restore point |
| `backup.restorePoints[].size` | complexType.UnitAndValue_long |  | Size of the restore point |
| `backup.restorePoints[].type` | dedicatedCloud.backup.BackupTypeEnum |  | Type of the restore point — one of `full`, `incremental` |
| `backup.retentionTime` | integer |  | Number of days before the backup is deleted |
| `backup.state` | dedicatedCloud.backup.StateEnum |  | State of the backup job — one of `deleting`, `delivered`, `disabled`, `disabling`, `enabling`, `error`, `migrating`, `pending`, `removed`, `stopping`, `toCreate`, `toDelete`, … |
| `cdroms` | dedicatedCloud.virtualMachineCdrom[] | read-only | Virtual machine cdroms devices |
| `cdroms[].connected` | boolean |  |  |
| `cdroms[].iso` | string |  |  |
| `clusterName` | string | read-only | Cluster of the virtual machine. |
| `cpuMax` | number | read-only | Maximum CPU performance, in MHz. |
| `cpuNum` | integer | read-only | Number of processors in the virtual machine. |
| `cpuReady` | number | read-only | Time that the virtual machine was ready, but could not get scheduled to run on the physical CPU. In millisecond |
| `cpuReadyPercent` | number | read-only | Percentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU. In percent |
| `cpuUsed` | integer | read-only | Current CPU performance, in MHz. |
| `filers` | dedicatedCloud.vmFiler[] | read-only | List of filers in use by the virtual machine. |
| `filers[].committed` | number |  |  |
| `filers[].disks` | dedicatedCloud.vmFilerDisk[] |  |  |
| `filers[].disks[].capacity` | number |  |  |
| `filers[].disks[].id` | string |  |  |
| `filers[].name` | string |  |  |
| `folderName` | string | read-only | Folder of the virtual machine. |
| `guestOsFamily` | string | read-only | VMware guest configured OS family |
| `hostName` | string | read-only | Name of the host hosting the virtual machine. |
| `license` | dedicatedCloud.spla.KmsLicenseIncludingLegacyEnum | read-only | Registered managed license — one of `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`, … |
| `memoryMax` | integer | read-only | Memory size of the virtual machine, in MB |
| `memoryTps` | string | read-only | Amount of guest memory that is shared with other virtual machines, in Mb |
| `memoryUsed` | integer | read-only | Current memory utilization, in MB |
| `moRef` | string | read-only | moRef of the virtual machine. |
| `name` | string | read-only | Name of the virtual machine. |
| `netPacketRx` | number | read-only | Number of packets received. |
| `netPacketTx` | number | read-only | Number of packets transmitted. |
| `netRx` | number | read-only | Rate at which data is received. In KB/s |
| `netTx` | number | read-only | Rate at which data is transmitted. In KB/s |
| `networks` | dedicatedCloud.vmNetwork[] | read-only | List of the networks link to this virtual machine |
| `networks[].allowGuestControl` | boolean |  |  |
| `networks[].backing` | dedicatedCloud.vmNetworkBacking |  | A structure describing the backing network of a the virtual machine |
| `networks[].backing.carpState` | string |  |  |
| `networks[].backing.deviceName` | string |  |  |
| `networks[].backing.portGroupKey` | string |  |  |
| `networks[].backing.portGroupName` | string |  |  |
| `networks[].backing.portKey` | string |  |  |
| `networks[].backing.portKeySecurityPolicy` | dedicatedCloud.DvsSecurityPolicy |  | A structure describing the vmware DVSSecurityPolicy data object |
| `networks[].backing.switchUuid` | string |  |  |
| `networks[].backing.type` | dedicatedCloud.vmNetworkBackingTypeEnum |  | The type of the network backing — one of `DVS`, `VSS` |
| `networks[].backing.useAutoDetect` | boolean |  |  |
| `networks[].backing.valueMoref` | string |  |  |
| `networks[].connected` | boolean |  |  |
| `networks[].controler` | string |  |  |
| `networks[].label` | string |  |  |
| `networks[].macAddress` | string |  |  |
| `networks[].startConnected` | boolean |  |  |
| `networks[].status` | dedicatedCloud.virtualDeviceConnectInfoStatus |  | The connectable virtual device status — one of `ok`, `recoverableError`, `unrecoverableError`, `untried` |
| `powerState` | dedicatedCloud.virtualMachinePowerState | read-only | Power state of the virtual machine. — one of `deleted`, `poweredOff`, `poweredOn`, `suspended` |
| `readLatency` | number | read-only | Amount of time for a read operation from the virtual disk. In millisecond |
| `readPerSecond` | number | read-only | Number of read issued per second to the virtual disk. In millisecond |
| `readRate` | number | read-only | Rate of reading data from the virtual disk. In KB/s |
| `roleFt` | string | read-only | The index of the current VM in instanceUuids array starting from 1, so 1 means that it is the primary VM. |
| `snapshotNum` | integer | read-only | Number of snapshot of the virtual machine. |
| `stateFt` | dedicatedCloud.virtualMachineFaultToleranceState | read-only | The fault tolerance state of the virtual machine. — one of `disabled`, `enabled`, `needSecondary`, `notConfigured`, `running`, `starting` |
| `vmId` | integer | read-only | Id of the virtual machine. |
| `vmwareTools` | string | read-only | Current version status of VMware Tools in the guest operating system. |
| `vmwareToolsVersion` | string | read-only | Current version of VMware Tools |
| `writeLatency` | number | read-only | Amount of time for a write operation from the virtual disk. In millisecond |
| `writePerSecond` | number | read-only | Number of write issued per second to the virtual disk. In millisecond |
| `writeRate` | number | read-only | Rate of writing data from the virtual disk. In KB/s |

```json
{
  "backup": {
    "allocatedDisk": 0,
    "backupDays": [
      "Friday"
    ],
    "backupRepositoryId": 0,
    "encryption": true,
    "lastCreationTime": "2024-01-01T12:00:00Z",
    "lastDuration": {
      "unit": "string",
      "value": 0
    },
    "lastResult": "failed",
    "lastSuccessfulCreationTime": "2024-01-01T12:00:00Z",
    "lastSuccessfulDuration": {
      "unit": "string",
      "value": 0
    },
    "offerType": "advanced",
    "restorePoints": [
      {
        "creationTime": "2024-01-01T12:00:00Z",
        "isCorrupted": true,
        "restorePointId": 0,
        "size": {
          "unit": "string",
          "value": 0
        },
        "type": "full"
      }
    ],
    "retentionTime": 0,
    "state": "deleting"
  },
  "cdroms": [
    {
      "connected": true,
      "iso": "string"
    }
  ],
  "clusterName": "string",
  "cpuMax": 0,
  "cpuNum": 0,
  "cpuReady": 0,
  "cpuReadyPercent": 0,
  "cpuUsed": 0,
  "filers": [
    {
      "committed": 0,
      "disks": [
        {
          "capacity": 0,
          "id": "string"
        }
      ],
      "name": "string"
    }
  ],
  "folderName": "string",
  "guestOsFamily": "string",
  "hostName": "string",
  "license": "OVHcloud managed",
  "memoryMax": 0,
  "memoryTps": "string",
  "memoryUsed": 0,
  "moRef": "string",
  "name": "string",
  "netPacketRx": 0,
  "netPacketTx": 0,
  "netRx": 0,
  "netTx": 0,
  "networks": [
    {
      "allowGuestControl": true,
      "backing": {
        "carpState": "string",
        "deviceName": "string",
        "portGroupKey": "string",
  …
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}");

print_r($result);
?>
```

## List licensed VMs

`GET /v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vmLicensed`

Link: https://developers.eu.ovhcloud.com/reference/private-cloud/managed-vmware/managed-vmware-vsphere/datacenter/virtual-machines/#get-dedicatedcloud-servicename-datacenter-datacenterid-vmlicensed

**Status:** Stable production version  
**IAM actions:** `pccVMware:apiovh:datacenter/vmLicensed/get`

List licensed VMs. Returns the virtual machines with a managed license, with their guest OS and license. Filter by license with `kmsLicense`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `datacenterId` | path | integer | yes | Id of the Datacenter |
| `kmsLicense` | query | dedicatedCloud.spla.KmsLicenseIncludingLegacyEnum |  | Only display virtual machines with this license — one of `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`, … |
| `serviceName` | path | string | yes | Domain of the service |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dedicatedCloud.virtualMachineLicensingSummary[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `guestOsFamily` | string |  | Guest Operating System reported by VMware tools |
| `license` | dedicatedCloud.spla.KmsLicenseIncludingLegacyEnum |  | Attached SPLA licensing — one of `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`, … |
| `moRef` | string |  | VMware Managed object Reference identifier |
| `name` | string |  | Virtual machine name |
| `vmId` | integer |  | Virtual machine identifier |

```json
[
  {
    "guestOsFamily": "string",
    "license": "OVHcloud managed",
    "moRef": "string",
    "name": "string",
    "vmId": 0
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vmLicensed" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vmLicensed")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vmLicensed");

print_r($result);
?>
```

## Disable CARP on a VM

`POST /v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/disableCarp`

Link: https://developers.eu.ovhcloud.com/reference/private-cloud/managed-vmware/managed-vmware-vsphere/datacenter/virtual-machines/#post-dedicatedcloud-servicename-datacenter-datacenterid-vm-vmid-disablecarp

**Status:** Stable production version  
**IAM actions:** `pccVMware:apiovh:datacenter/vm/disableCarp`

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.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `datacenterId` | path | integer | yes | Id of the Datacenter |
| `serviceName` | path | string | yes | Domain of the service |
| `vmId` | path | integer | yes | Id of the virtual machine. |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `macAddress` | string | yes | Mac address of the port to enable Carp |

```json
{
  "macAddress": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dedicatedCloud.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdBy` | string | read-only | Creator of the task |
| `createdFrom` | string | read-only | Origin of the task |
| `datacenterId` | integer | read-only | datacenterId of the associated dedicatedCloud.Datacenter object |
| `description` | string | read-only | Current progress description |
| `endDate` | string (date-time) | read-only | Task end date |
| `executionDate` | string (date-time) | read-only | Task execution date |
| `filerId` | integer | read-only | filerId of the associated dedicatedCloud.Filer object |
| `hostId` | integer | read-only | hostId of the associated dedicatedCloud.Host object |
| `lastModificationDate` | string (date-time) | read-only | Task last modification date |
| `maintenanceDateFrom` | string (date-time) | read-only | Maintenance task min allowed execution date |
| `maintenanceDateTo` | string (date-time) | read-only | Maintenance task max allowed execution date |
| `name` | string | read-only | Task name |
| `network` | string | read-only | network of the associated dedicatedCloud.Ip object |
| `networkAccessId` | integer | read-only | networkAccessId of the associated dedicatedCloud.AllowedNetwork object |
| `orderId` | integer | read-only | orderId of the associated billing.Order object |
| `parentTaskId` | integer | read-only | taskId of the parent dedicatedCloud.Task object |
| `progress` | integer | read-only | Current progress |
| `state` | dedicatedCloud.TaskStateEnum | read-only | Current Task state — one of `canceled`, `doing`, `done`, `error`, `fixing`, `toCancel`, `toCreate`, `todo`, `unknown`, `waitingForChilds`, `waitingTodo` |
| `taskId` | integer | read-only | Task id |
| `type` | string | read-only | Task type |
| `userId` | integer | read-only | userId of the associated dedicatedCloud.User object |
| `vlanId` | integer | read-only | vlanId of the parent dedicatedCloud.Vlan object |

```json
{
  "createdBy": "string",
  "createdFrom": "string",
  "datacenterId": 0,
  "description": "string",
  "endDate": "2024-01-01T12:00:00Z",
  "executionDate": "2024-01-01T12:00:00Z",
  "filerId": 0,
  "hostId": 0,
  "lastModificationDate": "2024-01-01T12:00:00Z",
  "maintenanceDateFrom": "2024-01-01T12:00:00Z",
  "maintenanceDateTo": "2024-01-01T12:00:00Z",
  "name": "string",
  "network": "string",
  "networkAccessId": 0,
  "orderId": 0,
  "parentTaskId": 0,
  "progress": 0,
  "state": "canceled",
  "taskId": 0,
  "type": "string",
  "userId": 0,
  "vlanId": 0
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/disableCarp" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: string
result = client.post("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/disableCarp",
	macAddress = None, # Mac address of the port to enable Carp (type: string)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: string
$result = $ovh->post("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/disableCarp", array(
	macAddress => null, // Mac address of the port to enable Carp (type: string)
));

print_r($result);
?>
```

## Enable CARP on a VM

`POST /v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/enableCarp`

Link: https://developers.eu.ovhcloud.com/reference/private-cloud/managed-vmware/managed-vmware-vsphere/datacenter/virtual-machines/#post-dedicatedcloud-servicename-datacenter-datacenterid-vm-vmid-enablecarp

**Status:** Stable production version  
**IAM actions:** `pccVMware:apiovh:datacenter/vm/enableCarp`

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.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `datacenterId` | path | integer | yes | Id of the Datacenter |
| `serviceName` | path | string | yes | Domain of the service |
| `vmId` | path | integer | yes | Id of the virtual machine. |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `macAddress` | string | yes | Mac address of the port to enable Carp |

```json
{
  "macAddress": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dedicatedCloud.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdBy` | string | read-only | Creator of the task |
| `createdFrom` | string | read-only | Origin of the task |
| `datacenterId` | integer | read-only | datacenterId of the associated dedicatedCloud.Datacenter object |
| `description` | string | read-only | Current progress description |
| `endDate` | string (date-time) | read-only | Task end date |
| `executionDate` | string (date-time) | read-only | Task execution date |
| `filerId` | integer | read-only | filerId of the associated dedicatedCloud.Filer object |
| `hostId` | integer | read-only | hostId of the associated dedicatedCloud.Host object |
| `lastModificationDate` | string (date-time) | read-only | Task last modification date |
| `maintenanceDateFrom` | string (date-time) | read-only | Maintenance task min allowed execution date |
| `maintenanceDateTo` | string (date-time) | read-only | Maintenance task max allowed execution date |
| `name` | string | read-only | Task name |
| `network` | string | read-only | network of the associated dedicatedCloud.Ip object |
| `networkAccessId` | integer | read-only | networkAccessId of the associated dedicatedCloud.AllowedNetwork object |
| `orderId` | integer | read-only | orderId of the associated billing.Order object |
| `parentTaskId` | integer | read-only | taskId of the parent dedicatedCloud.Task object |
| `progress` | integer | read-only | Current progress |
| `state` | dedicatedCloud.TaskStateEnum | read-only | Current Task state — one of `canceled`, `doing`, `done`, `error`, `fixing`, `toCancel`, `toCreate`, `todo`, `unknown`, `waitingForChilds`, `waitingTodo` |
| `taskId` | integer | read-only | Task id |
| `type` | string | read-only | Task type |
| `userId` | integer | read-only | userId of the associated dedicatedCloud.User object |
| `vlanId` | integer | read-only | vlanId of the parent dedicatedCloud.Vlan object |

```json
{
  "createdBy": "string",
  "createdFrom": "string",
  "datacenterId": 0,
  "description": "string",
  "endDate": "2024-01-01T12:00:00Z",
  "executionDate": "2024-01-01T12:00:00Z",
  "filerId": 0,
  "hostId": 0,
  "lastModificationDate": "2024-01-01T12:00:00Z",
  "maintenanceDateFrom": "2024-01-01T12:00:00Z",
  "maintenanceDateTo": "2024-01-01T12:00:00Z",
  "name": "string",
  "network": "string",
  "networkAccessId": 0,
  "orderId": 0,
  "parentTaskId": 0,
  "progress": 0,
  "state": "canceled",
  "taskId": 0,
  "type": "string",
  "userId": 0,
  "vlanId": 0
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/enableCarp" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: string
result = client.post("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/enableCarp",
	macAddress = None, # Mac address of the port to enable Carp (type: string)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: string
$result = $ovh->post("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/enableCarp", array(
	macAddress => null, // Mac address of the port to enable Carp (type: string)
));

print_r($result);
?>
```

## Remove a managed license

`POST /v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/removeLicense`

Link: https://developers.eu.ovhcloud.com/reference/private-cloud/managed-vmware/managed-vmware-vsphere/datacenter/virtual-machines/#post-dedicatedcloud-servicename-datacenter-datacenterid-vm-vmid-removelicense

**Status:** Stable production version  
**IAM actions:** `pccVMware:apiovh:datacenter/vm/removeLicense`

Remove a managed license. Removes the managed license from the virtual machine. Returns a task to track progress.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `datacenterId` | path | integer | yes | Id of the Datacenter |
| `serviceName` | path | string | yes | Domain of the service |
| `vmId` | path | integer | yes | Id of the virtual machine. |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dedicatedCloud.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdBy` | string | read-only | Creator of the task |
| `createdFrom` | string | read-only | Origin of the task |
| `datacenterId` | integer | read-only | datacenterId of the associated dedicatedCloud.Datacenter object |
| `description` | string | read-only | Current progress description |
| `endDate` | string (date-time) | read-only | Task end date |
| `executionDate` | string (date-time) | read-only | Task execution date |
| `filerId` | integer | read-only | filerId of the associated dedicatedCloud.Filer object |
| `hostId` | integer | read-only | hostId of the associated dedicatedCloud.Host object |
| `lastModificationDate` | string (date-time) | read-only | Task last modification date |
| `maintenanceDateFrom` | string (date-time) | read-only | Maintenance task min allowed execution date |
| `maintenanceDateTo` | string (date-time) | read-only | Maintenance task max allowed execution date |
| `name` | string | read-only | Task name |
| `network` | string | read-only | network of the associated dedicatedCloud.Ip object |
| `networkAccessId` | integer | read-only | networkAccessId of the associated dedicatedCloud.AllowedNetwork object |
| `orderId` | integer | read-only | orderId of the associated billing.Order object |
| `parentTaskId` | integer | read-only | taskId of the parent dedicatedCloud.Task object |
| `progress` | integer | read-only | Current progress |
| `state` | dedicatedCloud.TaskStateEnum | read-only | Current Task state — one of `canceled`, `doing`, `done`, `error`, `fixing`, `toCancel`, `toCreate`, `todo`, `unknown`, `waitingForChilds`, `waitingTodo` |
| `taskId` | integer | read-only | Task id |
| `type` | string | read-only | Task type |
| `userId` | integer | read-only | userId of the associated dedicatedCloud.User object |
| `vlanId` | integer | read-only | vlanId of the parent dedicatedCloud.Vlan object |

```json
{
  "createdBy": "string",
  "createdFrom": "string",
  "datacenterId": 0,
  "description": "string",
  "endDate": "2024-01-01T12:00:00Z",
  "executionDate": "2024-01-01T12:00:00Z",
  "filerId": 0,
  "hostId": 0,
  "lastModificationDate": "2024-01-01T12:00:00Z",
  "maintenanceDateFrom": "2024-01-01T12:00:00Z",
  "maintenanceDateTo": "2024-01-01T12:00:00Z",
  "name": "string",
  "network": "string",
  "networkAccessId": 0,
  "orderId": 0,
  "parentTaskId": 0,
  "progress": 0,
  "state": "canceled",
  "taskId": 0,
  "type": "string",
  "userId": 0,
  "vlanId": 0
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/removeLicense" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/removeLicense")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/removeLicense");

print_r($result);
?>
```

## Set a managed license

`POST /v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/setLicense`

Link: https://developers.eu.ovhcloud.com/reference/private-cloud/managed-vmware/managed-vmware-vsphere/datacenter/virtual-machines/#post-dedicatedcloud-servicename-datacenter-datacenterid-vm-vmid-setlicense

**Status:** Stable production version  
**IAM actions:** `pccVMware:apiovh:datacenter/vm/setLicense`

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

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `datacenterId` | path | integer | yes | Id of the Datacenter |
| `serviceName` | path | string | yes | Domain of the service |
| `vmId` | path | integer | yes | Id of the virtual machine. |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `bypassGuestOsFamilyCheck` | boolean | yes | Bypass compatibility check between managed license and current VMware guest configured OS family |
| `kmsLicense` | dedicatedCloud.spla.KmsLicenseEnum | yes | License to use — one of `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`, … |

```json
{
  "bypassGuestOsFamilyCheck": true,
  "kmsLicense": "windows 2016 Datacenter"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dedicatedCloud.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `createdBy` | string | read-only | Creator of the task |
| `createdFrom` | string | read-only | Origin of the task |
| `datacenterId` | integer | read-only | datacenterId of the associated dedicatedCloud.Datacenter object |
| `description` | string | read-only | Current progress description |
| `endDate` | string (date-time) | read-only | Task end date |
| `executionDate` | string (date-time) | read-only | Task execution date |
| `filerId` | integer | read-only | filerId of the associated dedicatedCloud.Filer object |
| `hostId` | integer | read-only | hostId of the associated dedicatedCloud.Host object |
| `lastModificationDate` | string (date-time) | read-only | Task last modification date |
| `maintenanceDateFrom` | string (date-time) | read-only | Maintenance task min allowed execution date |
| `maintenanceDateTo` | string (date-time) | read-only | Maintenance task max allowed execution date |
| `name` | string | read-only | Task name |
| `network` | string | read-only | network of the associated dedicatedCloud.Ip object |
| `networkAccessId` | integer | read-only | networkAccessId of the associated dedicatedCloud.AllowedNetwork object |
| `orderId` | integer | read-only | orderId of the associated billing.Order object |
| `parentTaskId` | integer | read-only | taskId of the parent dedicatedCloud.Task object |
| `progress` | integer | read-only | Current progress |
| `state` | dedicatedCloud.TaskStateEnum | read-only | Current Task state — one of `canceled`, `doing`, `done`, `error`, `fixing`, `toCancel`, `toCreate`, `todo`, `unknown`, `waitingForChilds`, `waitingTodo` |
| `taskId` | integer | read-only | Task id |
| `type` | string | read-only | Task type |
| `userId` | integer | read-only | userId of the associated dedicatedCloud.User object |
| `vlanId` | integer | read-only | vlanId of the parent dedicatedCloud.Vlan object |

```json
{
  "createdBy": "string",
  "createdFrom": "string",
  "datacenterId": 0,
  "description": "string",
  "endDate": "2024-01-01T12:00:00Z",
  "executionDate": "2024-01-01T12:00:00Z",
  "filerId": 0,
  "hostId": 0,
  "lastModificationDate": "2024-01-01T12:00:00Z",
  "maintenanceDateFrom": "2024-01-01T12:00:00Z",
  "maintenanceDateTo": "2024-01-01T12:00:00Z",
  "name": "string",
  "network": "string",
  "networkAccessId": 0,
  "orderId": 0,
  "parentTaskId": 0,
  "progress": 0,
  "state": "canceled",
  "taskId": 0,
  "type": "string",
  "userId": 0,
  "vlanId": 0
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v1/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/setLicense" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/setLicense",
	bypassGuestOsFamilyCheck = None, # Bypass compatibility check between managed license and current VMware guest configured OS family (type: boolean)
	kmsLicense = None, # License to use (type: dedicatedCloud.spla.KmsLicenseEnum)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/setLicense", array(
	bypassGuestOsFamilyCheck => null, // Bypass compatibility check between managed license and current VMware guest configured OS family (type: boolean)
	kmsLicense => null, // License to use (type: dedicatedCloud.spla.KmsLicenseEnum)
));

print_r($result);
?>
```
