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.
- Create an account;
- Login;
- 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.
$ ./6050015361872676-openrc.sh`
Alternatively, you can set the env variables manually.
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=""
GOOS=linux go build -o <elf_file>
ops image create <elf_file|program> -c config.json -t openstack -i <image_name>
ops image list -t openstack
ops image delete -t openstack <image_name>
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
ops instance create <image_name> -t openstack -f <flavor_name>
Sample config file
{
"CloudConfig" :{
"Platform" : "openstack",
"flavor" : "<flavor_name>"
}
}
OPS provides configurable instance volume size. Add volume size in config file. Default size is 1 GB.
{
"RunConfig": {
"VolumeSizeInGb" : 2
}
}
ops instance list -t openstack
ops instance logs -t openstack <instance_name>
ops instance delete -t openstack <instance_name>
You can fetch instance name from ops instance list command.
ops volume create -t openstack <volume_name>
$ 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 | |
+--------------------------------------+------+-----------+-----------+----------+-------------------------------+----------+
ops volume delete -t openstack <volume_name>
ops volume attach -t openstack <instance_name> <volume_name> <mount_path>
ops volume detach -t openstack <instance_name> <volume_name>