A VM group is a collection of virtual machines with similar host requirements. The virtual machines must all be in the same resource pool.

You must be a system administrator to create or update a VM group.

1

VM groups are properties of a resource pool.

Each VMWProviderVdcResourcePool element in a VMWProviderVdcResourcePoolSet response includes links that you can use to create or update VM groups in the resource pool.

<?xml version="1.0" encoding="UTF-8"?>
<VMWProviderVdcResourcePoolSet ...>
   ...
   <VMWProviderVdcResourcePool
      primary="true">
      <Link
         rel="migrateVms"
         href="https://vcloud.example.com/api/admin/extension/resourcePool/83/action/migrateVms" />
      <Link
         rel="resourcePoolVmList"
         href="https://vcloud.example.com/api/admin/extension/resourcePool/83/vmList" />
      <Link
         rel="down"
         href="https://vcloud.example.com/api/admin/extension/resourcePool/83/hostGroups"
         type="application/vnd.vmware.admin.vmwHostGroupsType+xml" />
      <Link
         rel="down"
         href="https://vcloud.example.com/api/admin/extension/resourcePool/83/vmGroups"
         type="application/vnd.vmware.admin.vmwVmGroupType+xml" />
      <Link
         rel="add"
         href="https://vcloud.example.com/api/admin/extension/resourcePool/83/vmGroups"
         type="application/vnd.vmware.admin.vmwVmGroupType+xml" />
      <Link
         rel="down"
         href="https://vcloud.example.com/api/admin/extension/resourcePool/83/rules"
         type="application/vnd.vmware.admin.vmwVmHostAffinityRules+xml" />
      ...
   </VMWProviderVdcResourcePool>
   ...
</VMWProviderVdcResourcePoolSet>
2

To create a VM group in the resource pool, make a POST request to the add link for vmGroups.

The request body is a VMWVmGroup element. See Example: Create a VM Group.

The request body specifies a name for the group.

Request:

POST https://vcloud.example.com/api/admin/extension/resourcePool/83/vmGroups
Content-type: application/vnd.vmware.admin.vmwVmGroupType+xml
...
<VMWVmGroup
   xmlns="http://www.vmware.com/vcloud/extension/v1.5"
   xmlns:vcloud_v1.5="http://www.vmware.com/vcloud/v1.5">
   <VmGroupName>ExampleGroup</VmGroupName>
</VMWVmGroup>

The response is a Task. When the task completes, you can retrieve the vmGroups in the resource pool to see the new VM Group. The system supplies a unique identifier and a count of VMs, initially 0, in the group.

GET https://vcloud.example.com/api/admin/extension/resourcePool/83/vmGroups
...
<vmext:VMWVmGroups ...>
   <vmext:VmGroup
      href="https://vcloud.example.com/api/admin/extension/vmGroup/34">
      <vcloud:Link
         rel="remove"
         href="https://vcloud.example.com/api/admin/extension/vmGroup/34" />
      <vcloud:Link
         rel="down"
         href="https://vcloud.example.com/api/admin/extension/vmGroup/34/vmsList"
         type="application/vnd.vmware.vcloud.VmGroupVmsRecord+xml" />
      <vcloud:Link
         rel="addVms"
         href="https://vcloud.example.com/api/admin/extension/vmGroup/name/foo/action/addVms"
         type="application/vnd.vmware.vcloud.vms+xml" />
      <vcloud:Link
         rel="removeVms"
         href="https://vcloud.example.com/api/admin/extension/vmGroup/name/foo/action/removeVms"
         type="application/vnd.vmware.vcloud.vms+xml" />
      <vmext:VmGroupId>34</vmext:VmGroupId>
      <vmext:VmGroupName>ExampleGroup</vmext:VmGroupName>
      <vmext:vmCount>0</vmext:vmCount>
   </vmext:VmGroup>
   ...
</vmext:VMWVmGroups>