OPS works perfectly fine with OpenStack.
Some cloud providers using OpenStack that have been tested are vexxhost and ovh .
In the cloud provider, download a script with the env variables required.
Click API Access
in left menu;
Click on button with the description Download OpenStack RC File
;
Select an option which contains the description RC File
.
Run RC file
script in the terminal where you will use ops.
Copy $ ./6050015361872676-openrc.sh`
Alternatively, you can set the env variables manually.
Copy export OS_USERNAME=""
export OS_PASSWORD=""
export OS_DOMAIN_NAME="Default"
export OS_AUTH_URL="https://auth.vexxhost.net/"
export OS_REGION_NAME="sjc1"
export OS_PROJECT_NAME=""
export OS_PROJECT_ID=""
Image Operations
Create Image
Copy GOOS=linux go build -o <elf_file>
ops image create <elf_file|program> -c config.json -t openstack -i <image_name>
List Images
Copy ops image list -t openstack
Delete Image
Copy ops image delete -t openstack <image_name>
Instance Operations
Create Instance
Copy ops instance create <image_name> -t openstack
While creating instance on openstack OPS needs flavour name. If you don't provide, OPS selects one for you. You can provide flavor name via CLI and config file.
CLI example
Copy ops instance create <image_name> -t openstack -f <flavor_name>
Sample config file
Copy {
"CloudConfig" : {
"Platform" : "openstack" ,
"flavor" : "<flavor_name>"
}
}
OPS provides configurable instance volume size. Add volume size in config file. Default size is 1 GB.
Copy {
"RunConfig" : {
"VolumeSizeInGb" : 2
}
}
List Instances
Copy ops instance list -t openstack
Get Logs for Instance
Copy ops instance logs -t openstack <instance_name>
Delete Instance
Copy ops instance delete -t openstack <instance_name>
You can fetch instance name from ops instance list command.
Volume Operations
Create Volume
Copy ops volume create -t openstack <volume_name>
List Volumes
Copy $ ops volume list -t openstack
+--------------------------------------+------+-----------+-----------+----------+-------------------------------+----------+
| UUID | NAME | STATUS | SIZE (GB) | LOCATION | CREATED | ATTACHED |
+--------------------------------------+------+-----------+-----------+----------+-------------------------------+----------+
| 2977268e-7c83-4191-a30d-f6fa25c3ddab | | available | 1 | | 2021-02-24 13:24:54 +0000 UTC | |
+--------------------------------------+------+-----------+-----------+----------+-------------------------------+----------+
Delete Volume
Copy ops volume delete -t openstack <volume_name>
Attach Volume
Copy ops volume attach -t openstack <instance_name> <volume_name> <mount_path>
Detach Volume
Copy ops volume detach -t openstack <instance_name> <volume_name>