CB‐Spider Zone Based Control Testing Guide - cloud-barista/cb-spider GitHub Wiki

Zone-Based Control is a feature provided by CB-Spider in Cloud-Barista, allowing resource creation and management not only in the Default Zone within a single Connection but also in other Target Zones. For more, Check the Zone-based Control wiki document.
- CB-SPIDER: 0.10.1
- CSP: AWS
- Region: us-east-2
- Default Zone: us-east-2a (United States, Ohio)
- Target Zone: us-east-2b (United States, Ohio)
- VM Spec: t2.micro
- VM Image: ami-00afc76f2b7273d3b
- Disk: Size - 1GB / Type - gp2
Verify the zone information of the provisioned resources(Subnet, Disk, VM).
- List all resources created in the default and target zones.
- Ensure the zone information matches the expected configuration.
- Resource details include accurate zone information.
Figure 1: VPC/Subnet Management
Figure 2: Disk Management
Figure 3: VM Provisioning Info
Test resource provisioning in the default zone (us-east-2a).
- Create a subnet
s1and diskd1in the default zone (us-east-2a). - Create a Security Group for
s1. - Provision a VM in the subnet
s1. - Attach the disk
d1to the VM. - Detach the disk
d1from the VM.
- Subnet
s1and diskd1are successfully created in the default zone (us-east-2a). - VM1 is successfully created in the
us-east-2azone. - Disk
d1is successfully attached to theVM1. - Disk
d1is successfully detached from theVM1.
Figure 4: Disk Attach to Default Zone |
Figure 5: Disk Detach from Default Zone |
Test resource provisioning in the target zone (us-east-2b).
- Create a subnet
s2and diskd2in the target zone (us-east-2b). - Create a Security Group for
s2 - Provision a
VM2in the subnets2. - Attach the disk
d2to theVM2. - Detach the disk
d2from theVM2.
- Subnet
s2and diskd2are successfully created in the target zone (us-east-2b). -
VM2is successfully created in theus-east-2bzone. - Disk
d2is successfully attached to theVM2. - Disk
d2is successfully detached from theVM2
Figure 6: Disk Attach to Target Zone |
Figure 7: Disk Detach from Target Zone |
Validate error handling when there is a zone mismatch.
- Attempt to interaction with a resource in an incorrect zone.
- Attempt to attach
d1(inus-east-2a) toVM2(inus-east-2b) using the API / CLI - Observe the error message returned by the system.
-
Method:
PUT - Endpoint: `http://localhost:1024/spider/disk/aws-ohio-disk-1/attach
-
Request Body:
{ "ConnectionName": "aws-config01", "ReqInfo": { "VMName": "aws-ohio-vm-2" } }
- System Should return a Zone Mismatch Error response, clearly indicating that the disk and the VM are not in the same availability zone.
{
"message": "InvalidVolume.ZoneMismatch: The volume 'vol-0fb0eede632787658' is not in the same availability zone as instance 'i-08bdefda0ac12fef5'\nstatus code: 400, request id: 60e134ec-8477-4679-88a8-a70d057a62c8"
}You can view the Zone-Based Control Test results for each CSP's resources at the link below:
🔗 View Google Spreadsheet
By following this guide, you can successfully test the Zone-Based Control feature in CB-SPIDER and ensure it operates as expected under various scenarios.