REST API - get

vcenter vm hardware: get

Returns the virtual hardware settings of a virtual machine.

Request:

HTTP request

GET https://{server}/rest/vcenter/vm/{vm}/hardware

Path Parameters

Name Type Description
Required
vm string Virtual machine identifier.

Response:

HTTP Status Code: 200

Representation:

{
    "value"{
        "upgrade_policy""NEVER",
        "upgrade_status""NONE",
        "upgrade_error"{},
        "upgrade_version""VMX_03",
        "version""VMX_03"
    }
}

Response Type:

Name Type Description
bold = required
value info Virtual hardware settings of the virtual machine.
value.version string Virtual hardware version.

Defines the valid virtual hardware versions for a virtual machine. See https://kb.vmware.com/s/article/1003746 (Virtual machine hardware versions (1003746)). Value is one of:
VMX_03: Hardware version 3, first supported in ESXi 2.5.
VMX_04: Hardware version 4, first supported in ESXi 3.0.
VMX_06: Hardware version 6, first supported in WS 6.0.
VMX_07: Hardware version 7, first supported in ESXi 4.0.
VMX_08: Hardware version 8, first supported in ESXi 5.0.
VMX_09: Hardware version 9, first supported in ESXi 5.1.
VMX_10: Hardware version 10, first supported in ESXi 5.5.
VMX_11: Hardware version 11, first supported in ESXi 6.0.
VMX_12: Hardware version 12, first supported in Workstation 12.0.
VMX_13: Hardware version 13, first supported in ESXi 6.5.
VMX_14: Hardware version 14, first supported in ESXi 6.7. This constant was added in vSphere API 6.7.
VMX_15: Hardware version 15, first supported in ESXi 6.7 Update 2. This constant was added in vSphere API 6.7.2.
VMX_16: Hardware version 16, first supported in Workstation 15.0. This constant was added in vSphere API 7.0.0.0.
VMX_17: Hardware version 17, first supported in ESXi 7.0.0-0. This constant was added in vSphere API 7.0.0.0.
VMX_18: Hardware version 18, first supported in ESXi 7.0 U1. This constant was added in vSphere API 7.0.1.0.
VMX_FUTURE: Future hardware version, not supported yet. Warning: This constant is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

value.upgrade_policy string Scheduled upgrade policy.

Defines the valid virtual hardware upgrade policies for a virtual machine. Value is one of:
NEVER: Do not upgrade the virtual machine when it is powered on.
AFTER_CLEAN_SHUTDOWN: Run scheduled upgrade when the virtual machine is powered on after a clean shutdown of the guest operating system.
ALWAYS: Run scheduled upgrade when the virtual machine is powered on.

value.upgrade_version string Target hardware version to be used on the next scheduled virtual hardware upgrade.

Defines the valid virtual hardware versions for a virtual machine. See https://kb.vmware.com/s/article/1003746 (Virtual machine hardware versions (1003746)). Value is one of:
VMX_03: Hardware version 3, first supported in ESXi 2.5.
VMX_04: Hardware version 4, first supported in ESXi 3.0.
VMX_06: Hardware version 6, first supported in WS 6.0.
VMX_07: Hardware version 7, first supported in ESXi 4.0.
VMX_08: Hardware version 8, first supported in ESXi 5.0.
VMX_09: Hardware version 9, first supported in ESXi 5.1.
VMX_10: Hardware version 10, first supported in ESXi 5.5.
VMX_11: Hardware version 11, first supported in ESXi 6.0.
VMX_12: Hardware version 12, first supported in Workstation 12.0.
VMX_13: Hardware version 13, first supported in ESXi 6.5.
VMX_14: Hardware version 14, first supported in ESXi 6.7. This constant was added in vSphere API 6.7.
VMX_15: Hardware version 15, first supported in ESXi 6.7 Update 2. This constant was added in vSphere API 6.7.2.
VMX_16: Hardware version 16, first supported in Workstation 15.0. This constant was added in vSphere API 7.0.0.0.
VMX_17: Hardware version 17, first supported in ESXi 7.0.0-0. This constant was added in vSphere API 7.0.0.0.
VMX_18: Hardware version 18, first supported in ESXi 7.0 U1. This constant was added in vSphere API 7.0.1.0.
VMX_FUTURE: Future hardware version, not supported yet. Warning: This constant is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.Optional. It is only relevant when upgrade_policy has value [AFTER_CLEAN_SHUTDOWN, ALWAYS]. This field is optional and it is only relevant when the value of upgrade_policy is one of AFTER_CLEAN_SHUTDOWN or ALWAYS.

value.upgrade_status string Scheduled upgrade status.

Defines the valid virtual hardware upgrade statuses for a virtual machine. Value is one of:
NONE: No scheduled upgrade has been attempted.
PENDING: Upgrade is scheduled but has not yet been run.
SUCCESS: The most recent scheduled upgrade was successful.
FAILED: The most recent scheduled upgrade was not successful.

value.upgrade_error exception Reason for the scheduled upgrade failure.

Optional. It is only relevant when upgrade_status has value FAILED. This field is optional and it is only relevant when the value of upgrade_status is FAILED.

Errors:

HTTP Status Code Type Description
500 error if the system reports an error while responding to the request.
404 not_found if the virtual machine is not found.
500 resource_inaccessible if the virtual machine's configuration state cannot be accessed.
503 service_unavailable if the system is unable to communicate with a service to complete the request.
401 unauthenticated if the user can not be authenticated.
403 unauthorized if the user doesn't have the required privileges.