Usage Method

To use affinity group policies for better managing VM instances and hosts, follow the two usage methods below:
  • Resource Pool > Affinity Group
  • Resource Pool > VM Instance

Affinity Group

This topic mainly describes how to use affinity groups to better manage VM instances and hosts via the method from Resource Pool > Affinity Group.

Affinity Group Management Page

In the navigation pane of the ZStack Private Cloud UI, choose Resource Pool > Affinity Group to enter the Affinity Group management page.

On the Affinity Group management page, you can view the information of all currently existing affinity groups, including the affinity group name, specified policy, binding VM count, affinity group type, owner, and creation time. Also, more operations are supported, such as creating, enabling, and disabling an affinity group, as shown in Affinity Group Management Page.

Figure 1. Affinity Group Management Page


Create Affinity Group

On the Affinity Group management page, click Create Affinity Group. On the displayed Create Affinity Group page, set the following parameters:
  • Name: Enter a name for the affinity group.
  • Description: Optional. Enter a description for the affinity group.
  • Policy: Select an affinity group policy.
    Currently, ZStack provides the following two types of affinity group policy to better manage VM instances and hosts.
    • Anti-affinity group (soft):

      Allocate VM instances in the affinity group to different hosts as much as possible. If no more hosts are available, the VM instances will be allocated randomly.

    • Anti-affinity group (hard):

      Strictly allocate VM instances in the affinity group to different hosts. If no more hosts are available, the allocation fails.

You can create an anti-affinity group, as shown in Create Anti-Affinity Group (Soft).
Figure 2. Create Anti-Affinity Group (Soft)


Affinity Group Operations

You can perform the following operations on an affinity group:
  • Create: Create a new affinity group in the current zone.
  • Enable: Re-enable the selected affinity group to check whether VM instances within the affinity group can satisfy the affinity group policy. If the affinity group policy is met, the affinity group will be enabled successfully, or vice versa.
  • Disable: Disable the affinity group that you selected. Then, VM instances within the group will stop following the affinity group policy.
  • Bind VM instance: Bind new VM instances to the affinity group. Then, the affinity group policy will take effect immediately.
  • Unbind VM instance: Unbind VM instances from the affinity group. Then, the affinity group policy will take effect immediately.
  • Change owner: Change an owner for the affinity group.
  • Delete: Delete the affinity group that you selected. Then, VM instances within the group will no longer follow the affinity group policy when starting next time.

Constraints

  • Currently, the affinity group policy supports two types of affinity group: affinity group (soft) and affinity group (hard). These two types support the HOST type, which means that an affinity relationship between VM instances and hosts can be formed.
  • The number of VM instances that an affinity group can bind is not limited. In addition, the affinity group does not have quota limits, indicating that you can create limitless affinity groups.
  • The scope of an affinity group is the entire zone where the effect object is all hosts that meet the constraints.
  • One VM instance can be bound by only one affinity group at a time.
  • To change an affinity group to which a VM instance belongs, make sure that this VM instance is in the running state or stopped state.
  • After you change an affinity group for a VM instance on a local storage, the VM instance will be preferentially started on the host where the VM instance is running last time without following the new group policy. This helps to avoid unnecessary migrations.
  • After you change an affinity group for a VM instance on a shared storage, the VM instance will be started according to the new group policy.
  • If you bind or unbind a VM instance, the affinity group policy will take effect immediately. Only when you bind VM instances that are in the stopped state on a shared storage to an affinity group, the group policy takes effect when the VM instances are started next time.
  • Migrating VM instances will also follow an affinity group policy.
  • By default, all vRouters and VPC vRouters belong to one affinity group, known as system affinity group, where anti-affinity group (soft) is adopted. Specifically, this affinity group only allows you to perform enabling and disabling operations except for other operations.
  • Admin accounts and regular accounts are all allowed to create affinity groups.
  • Admin accounts can manage all affinity groups, while regular accounts can only manage the affinity groups owned by themselves.

VM Instance

This topic mainly describes how to use affinity groups to better manage VM instances and hosts via the usage method from Resource Pool > VM Instance.

Create VM Instance with Affinity Group

In the navigation pane of the ZStack Private Cloud UI, choose Resource Pool > VM Instance. On the VM Instance management page, click Create VM Instance. On the displayed Create VM Instance page, set the following parameters:
  • Add Type: Select single.
  • Name: Enter a name for the VM instance.
  • Description: Optional. Enter a description for the VM instance.
  • Instance Offering: Select an appropriate instance offering.
  • Image: Select an image for the VM instance.
  • Network: Select a network for the VM instance.
  • Advanced: Optional. Customize your advanced settings for the VM instance as needed.
    If you want the VM instance to follow an affinity group policy, select an affinity group as follows:
    • Affinity Group: Select an existing affinity group. Make sure that you specify an affinity group policy and a type for the affinity group.
Create a V instance with an anti-affinity group, as shown in Create VM Instance with Affinity Group.
Figure 1. Create VM Instance with Affinity Group




VM Operations on Affinity Group

A VM instance allows you to perform the following operations on an affinity group:
  • Create VM instance by specifying affinity group: Specify an affinity group when you create a VM instance. Then, the VM instance will be created based on the specified affinity group policy.
  • Clone VM instance by specifying affinity group: Specify an affinity group when you clone a VM instance. Then, the VM instance will be cloned based on the specified affinity group policy.
  • Bind affinity group: Bind the VM instance to the affinity group. Then, the affinity group policy will take effect for the VM instance.
  • Unbind affinity group: Unbind the VM instance from the affinity group. Then, the affinity group policy will take effect immediately for the VM instance.

Constraints

When you create a VM instance, if you specify an affinity group and a host simultaneously via the VM advanced settings, note the following:
  • With an anti-affinity group (soft),
    • When the specified host satisfies the condition to create VM instances, but does not meet the specified anti-affinity group policy (soft), you can create these VM instances successfully.
    • When the specified host does not satisfy the condition to create VM instances, you fail to create these VM instances.
  • With an anti-affinity group (hard),
    • When the specified host satisfies the condition to create VM instances, but does not meet the specified anti-affinity group (hard), you fail to create these VM instances.
    • When the specified host does not satisfy the condition to create VM instances, you fail to create the VM instance.

Back to Top

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.