You can control the virtual machine (VM) resource allocation and placement on a specific cluster or host by using VM sizing policies, VM placement policies, and starting with VMware Cloud Director 10.3.2, vGPU policies.
VMware Cloud Director system administrators create and manage VM sizing, VM placement, and vGPU policies at a global level and can publish individual policies to one or more organization virtual data centers (VDCs). Additionally, if a user saves a vApp as a vApp template to a catalog, the template also includes the vGPU, placement, and sizing policies of the original vApp as unmodifiable tagged policies.
When you publish a policy to an organization VDC, the policy becomes available to the users in the organization. When creating and managing VMs in the organization VDC, tenants can assign the available policies to the VMs. Tenants and users in the organization VDC cannot look into the specific configuration of a policy.
VM placement, VM sizing, and vGPU policies are a mechanism for cloud providers to define and offer differentiated levels of service, for example, a CPU intensive profile or a high memory usage profile. If you publish multiple VM placement, VM sizing, and vGPU policies to an organization VDC, tenant users can select between all custom policies and the default policy when creating and managing VMs in the organization VDC. The System Default policy is auto-generated for every VDC. You can delete the System Default policy in the VDC and mark another custom policy as the default. Every VDC must have a default compute policy. You can set as a default policy of a VDC any of the three compute policy types. The automaticaly generated System Default policy does not define any values and allows all virtual machine configurations.
- VM placement policy
- A VM placement policy defines the placement of a virtual machine on a host or group of hosts. It is a mechanism for cloud provider administrators to create a named group of hosts within a provider VDC. The named group of hosts is a subset of hosts within the provider VDC clusters that might be selected based on any criteria such as performance tiers or licensing. You can expand the scope of a VM placement policy to more than one provider VDC.
- VM sizing policy
-
A VM sizing policy defines the compute resource allocation for virtual machines within an organization VDC. The compute resource allocation includes CPU and memory allocation, reservations, limits, and shares.
With VM sizing policies, VMware Cloud Director system administrators can control the following aspects of compute resources consumption at the virtual machine level:
- Number of vCPUs and vCPU clock speed
- Amount of memory allocated to the virtual machine
- Memory and CPU reservation, limit, and shares
- Extra Configurations.
The
extraConfigs
API parameter represents a mapping between a key and value pairs that are applied as extra configuration values on a virtual machine. You can create a policy with extra configurations only by using the vCloud API. Existing extra configurations appear in the Service Provider Admin Portal UI under Extra Configurations in the detailed VM sizing policy view.
You define the VM sizing policies at a global level. For more information about the VM sizing policy attributes, see Attributes of VM Sizing Policies.
VMware Cloud Director generates a default VM sizing policy for all VDCs. The default VM sizing policy contains only a name and description, and all remaining policy attributes are empty.
You can also define another VM sizing policy as the default policy for an organization VDC. The default VM sizing policy controls the resource allocation and consumption of the virtual machines that tenants create in the organization VDC, unless a tenant assigns another specific VM sizing policy to the virtual machine.
To limit the maximum compute resources that tenants can allocate to individual virtual machines within an organization VDC, cloud providers can define a maximum VM sizing policy. When assigned to an organization VDC, the maximum VM sizing policy acts as an upper bound for the compute resource configuration for all virtual machines within the organization VDC. The maximum VM sizing policy is not available to tenant users when creating a virtual machine. When you define a VM sizing policy as the maximum policy, VMware Cloud Director copies internally the content of the policy and uses the copied content as the maximum VM sizing policy. As a result, the organization VDC does not depend on the initially used VM sizing policy.
By using VM sizing policies, cloud providers can restrict the compute resources consumption for all virtual machines within an organization VDC to, for example, three predefined sizes, Small Size, Medium Size, and Large Size. The workflow is the following.- A system administrator creates three VM sizing policies with the following attributes.
Name Attributes Small Size - Description: Small-sized VM policy
- Name: Small Size
- Memory: 1024
- Number of vCPUs: 1
Medium Size - Description: Medium-sized VM policy
- Name: Medium Size
- Memory: 2048
- Number of vCPUs: 2
Large Size - Description: Large-sized VM policy
- Name: Large Size
- Memory: 4096
- Number of vCPUs: 4
- Publish the new VM sizing policies to an organization VDC.
- Optionally define one of the VM sizing policies as a default VM sizing policy for the organization VDC.
- vGPU policy
- Starting with VMware Cloud Director 10.3.2, you can create, manage, and publish vGPU policies. When creating a VM, tenant users can select between creating a VM for general purposes or a vGPU enabled VM that requires vGPU resources.
- To define the placement of a VM on a host or group of hosts, create a placement policy. See Create a VM Placement Policy within a Provider VDC.
- To control the physical compute resource allocation for tenant workloads, create a sizing policy. See Create a VM Sizing Policy.
- For version 10.3.2 and later, to define the placement and compute resource allocation of a vGPU enabled VM, create a vGPU policy. See Create a vGPU Policy.
- Publish a policy to one or more organization VDCs. See Add a VM Placement Policy to an Organization VDC, Add a VM Sizing Policy to an Organization VDC, and Add a vGPU Policy to an Organization VDC.
- Set a VM placement policy, a VM sizing policy, or a vGPU policy as default.
- Edit a policy.
- Unpublish a policy from an organization VDC.
- Delete a policy. See Delete a VM Placement Policy, Delete a VM Sizing Policy, and Delete a vGPU Policy.
Users that have the ORG_VDC_MANAGE_COMPUTE_POLICIES right can create, update, and publish VM sizing, VM placement, and vGPU policies.
Operation | Description |
---|---|
Assign a policy to a virtual machine during a virtual machine creation. | Tenant users that are authorized to create virtual machines in an organization VDC can optionally assign VM sizing, VM placement, and vGPU policies to VMs by using the VMware Cloud Director Tenant Portal. As a result, the parameters defined in a VM sizing policy control the CPU and memory consumption of the VM. The sizing parameters defined in a vGPU policy can also optionally control the CPU and memory consumption of the VM. Assigning a VM placement or sizing policy is not a requirement for tenants during a VM creation. If a tenant does not explicitly select a VM sizing policy to assign to a VM, the default VM sizing is applied to the virtual machine. If you do not create and publish any VM placement policies, the VM placement policy option is not visible to the tenants. In VMware Cloud Director version 10.3.2 and later, if you do not create and publish any vGPU policies, the tenants can create only general purpose VMs. If a tenant selects a VM placement or vGPU policy that has sizing information, the VM sizing policy option becomes hidden to the tenant. You can create a VM placement policy with sizing information only by using the vCloud API. If there is only one VM sizing policy, the VM sizing policy option is not visible to the tenants. When the system administrator sets the vCPU Count, Cores Per Socket, and Memory attributes in a VM sizing or vGPU policy, if a tenant selects the policy, these values are shown, but not editable. |
Assign a policy to an existing virtual machine. | Tenant users that are authorized to manage VMs in an organization VDC can assign or change the VM sizing, VM placement, and vGPU policies of an existing VM using the VMware Cloud Director Tenant Portal. When a tenant changes the VM placement or vGPU policy, the VM moves to a new host as per the VM-host affinity rule defined in the new policy. When a tenant changes a VM sizing policy or vGPU policy with defined sizing information, the system reconfigures the VM to consume compute resources as specified in the new policy. |
The workflow for working with VM placement and VM sizing policies is the following.
- You creates one or more VM placement policies. See Create a VM Placement Policy within a Provider VDC.
When you create a VM placement policy to be scoped for a single provider VDC, the name of the VM placement policy must be unique within the provider VDC scope of the policy. If you create a VM placement policy scoping more than one provider VDC, the VM placement policy name becomes unique globally within the VMware Cloud Director site.
- You create one or more VM sizing policies. See Create a VM Sizing Policy.
The names of VM sizing policies are unique in a single VMware Cloud Director site.
- In VMware Cloud Director 10.3.2 and later, you create one or more vGPU policies. See Create a vGPU Policy.
The names of vGPU policies are unique in a single VMware Cloud Director site.
- You publish the VM placement, VM sizing, and vGPU policies to one or more organization VDCs. See Add a VM Placement Policy to an Organization VDC, Add a VM Sizing Policy to an Organization VDC, and Add a vGPU Policy to an Organization VDC.
Publishing a policy makes it available for tenant users in the organization VDCs during virtual machine creation and virtual machine editing.
- When creating or updating a VM, tenants can use the VMware Cloud Director API or the VMware Cloud Director Tenant Portal to assign a VM sizing, VM placement, and vGPU policy to a VM.