You can control the virtual machine (VM) resource allocation and placement on a specific cluster or host by using VM sizing policies and VM placement policies.
VMware Cloud Director system administrators create and manage VM sizing policies at a global level and can publish individual policies to one or more organization VDCs. For VMware Cloud Director 10.2.1 and earlier, you can create and manage VM placement policies for each provider VDC separately, because a VM placement policy is scoped at the provider VDC level. Starting with VMware Cloud Director 10.2.2, you can include more than one provider VDC in the scope of a VM placement policy. In addition, starting with version 10.2.2, if a user saves a vApp as a vApp template to a catalog, the template includes also the 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 virtual machines in the organization VDC, tenants can assign the available policies to the virtual machines. Tenants and users in the organization VDC cannot look into the specific configuration of a VM placement policy or a VM sizing policy.
VM placement and sizing 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 and VM sizing 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. The 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. Starting with VMware Cloud Director 10.2.2, you can expand the scope of a VM placement policy to more than one provider VDC.
A VM placement policy defines VM-host affinity rules that directly impact the placement of tenant workloads. Administrators define or expose named host groups by using VM groups in
vCenter Server. A VM group has a direct affinity to a host group and represents the host group to which it has the affinity.
You define the VM placement policy at the provider VDC level. A VM placement policy includes the following attributes:
- Name (must be unique in the provider VDC)
- A set of one or more VM groups selected from the underlying clusters in the provider VDC. You can select one VM group per cluster
A VM placement policy is optional during the creation of a virtual machine and a tenant can assign only one VM placement policy to a virtual machine.
When a tenant creates a virtual machine in the organization VDC and selects the VM placement policy, VMware Cloud Director adds the virtual machine to the VM group or VM groups that are referenced in the policy. As a result, VMware Cloud Director creates the virtual machine on the appropriate host.
A VM placement policy can have zero or one VM group from each cluster. For example, the VM placement policy oracle_license can comprise VM groups oracle_license1 and oracle_license2, where VM group oracle_license1 belongs to cluster oracle_cluster1, and VM group oracle_license2 belongs to cluster oracle_cluster2.
When you assign a VM placement policy to a virtual machine, the placement engine adds this virtual machine to the corresponding VM group of the cluster on which it resides. For example, if you select to deploy a virtual machine on cluster oracle_cluster1 and assign the VM placement policy oracle_license to this virtual machine, the placement engine adds the virtual machine to VM group oracle_license1.
- 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.
extraConfigsAPI 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
- Description: Medium-sized VM policy
- Name: Medium Size
- Memory: 2048
- Number of vCPUs: 2
- 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.
- To define the placement of a virtual machine 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.
- Publish a VM placement or VM sizing policy to one or more organization VDCs. See Add a VM Placement Policy to an Organization VDC
- Set a VM placement or VM sizing policy as default.
- Edit a VM placement policy and a VM sizing policy. You can only edit the name and description of the policy in the VMware Cloud Director UI.
- Unpublish a VM placement or VM sizing policy from an organization VDC.
- Delete a VM placement or VM sizing policy. See Delete a VM Placement Policy and Delete a VM Sizing Policy.
Users that have the ORG_VDC_MANAGE_COMPUTE_POLICIES right can create, update, and publish VM placement and VM sizing policies.
|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 and VM placement policies to virtual machines by using the VMware Cloud Director Tenant Portal. As a result, the parameters defined in the VM sizing policy control the CPU and memory consumption of the virtual machine. Assigning a VM placement or sizing policy is not a requirement for tenants during a virtual machine creation. If a tenant does not explicitly select a VM sizing policy to assign to a virtual machine, the default VM sizing is applied to the virtual machine.
If you do not create any VM placement policy, the VM placement policy option is not visible to the tenants. If the tenant selects a placement 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 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 virtual machines in an organization VDC can assign or change the VM sizing and VM placement policies of an existing virtual machine using the VMware Cloud Director Tenant Portal. When a tenant changes the VM placement policy, the virtual machine moves to a new host as per the VM-host affinity rule defined in the new VM placement policy. When a tenant changes a VM sizing policy, the system reconfigures the virtual machine to consume compute resources as specified in the new VM sizing policy.|
The workflow for working with VM placement and VM sizing policies is the following.
- A system administrator creates one or more VM placement policies. See Create a VM Placement Policy within a Provider VDC.
- A system administrator creates one or more VM sizing policies. See Create a VM Sizing Policy.
The name of a VM sizing policy is unique in a single VMware Cloud Director site. The name of a VM placement policy is unique within the provider VDC scope of the policy.
- A system administrator publishes the VM placement and VM sizing policies to one or more organization VDCs. See Add a VM Placement Policy to an Organization VDC.
Publishing a VM placement policy makes it available for tenant users in the organization VDCs during virtual machine creation and virtual machine editing.
- When creating or updating a virtual machine, tenants can use the vCloud API or the VMware Cloud Director Tenant Portal to assign a VM sizing policy and a VM placement policy to a virtual machine.