Affinity groups are pivotal for optimizing cloud computing environments. By categorizing instances into affinity groups, users or administrators gain a nuanced control over the deployment of instances across hosts. One significant aspect is the utilization of host anti-affinity, ensuring that instances offering similar services are distributed across different hosts, thereby enhancing fault tolerance. This strategy mitigates the risk of service disruption in the event of a host failure, as redundant instances remain operational on alternative hosts. Conversely, host affinity facilitates the co-location of instances on the same host, fostering improved connectivity and minimized latency between interconnected instances. The flexibility of non-strict host anti-affinity and non-strict host affinity further refines deployment options, allowing for optimal resource allocation while prioritizing fault tolerance and performance considerations. These capabilities empower users to fine-tune their cloud infrastructure to meet specific operational requirements and performance objectives.
For a well-defined distribution strategy, it's advisable to define your affinity groups in advance.
An affinity group operates on an Account level and can be easily created from the navigation menu by following these steps:
1. Navigate to Compute → Affinity groups on left navigation bar.
2. Click on Add new affinity group in the top row:
3. Specify the following parameters in the popup window:
Host affinity deploys instances on the same host whenever possible, while host anti-affinity spreads them across different hosts.
Non-strict types offer more flexibility and may utilize the same or different hosts if resources permit, even if instructed otherwise. Strict types always prioritize adhering strictly to the rule.
4. Click on OK to save and create the affinity group.
Once an affinity group is created, it can be assigned during the creation process of an instance like this:
1. Navigate to Compute → Instance on the left navigation bar.
2. Click on Add instance in the top row:
For more help and information on this topic, refer to our Creating Instances chapter.
3. During the creation process in the Advanced mode setting, you can select any affinity group from the list view:
4. Complete the creation process by specifying the remaining parameters and click on Launch instance to set up the new instance with the affinity group successfully.
To change or assign new affinity groups to existing instances, follow these steps:
1. Navigate to Compute → Instance on the left navigation bar.
2. Select the instance from the list view to which you want to change the affinity group.
3. Click on Change affinity in the right top action toolbar:
Note that the instance must be stopped in order to access the affinity group option.
4. Select a new affinity group from the window.
5. Click on OK and Start instance again and you're ready to go.
After an affinity group is assigned you can view and manage them easily, following these steps:
1. Navigate to Compute → Affinity groups on the left navigation bar.
2. Select a specific affinity group from the list.
3. In the detail view click on View Instances in the left information block:
4. You'll be redirected to a list containing all members of an affinity group, where you can individually edit and manage each instance.
To delete a user data, follow these steps:
1. Navigate to Compute → Affinity groups on the left navigation bar.
2. Mark one or more affinity group from the list view.
3. Click on the Delete affinity group button in the top row:
4. Click on OK and the operation window will provide you with the status of the affinity group deletion process.
Instances previously assigned to an affinity group will be removed from it. They will continue operating normally on their current hosts but will no longer adhere to the host allocation rules of the former affinity group upon restart.