Acronis Cyber Infrastructure/Virtuozzo Hybrid Infrastructure S3 admin command line
Acronis Cyber Infrastructure (ACI)/Virtuozzo Hybrid Infrastructure (VHI) provides a command line interface (CLI) utility for administering S3 accounts, users, buckets etc. called “ostor-s3-admin“, however it isn’t the most intuitive CLI tool to use and the documentation for this is both somewhat sparse and rather scattered around in multiple different places.
The first issue you will probably run into when trying to use the “ostor-s3-admin” command is the following error message:
Volume id (-V) must be specified
You can get a list of all of your volume IDs by running “ostor-ctl get-config -V“. This will give you something like the following:
VOL_ID TYPE STATE
0100000000000002 OBJ READY
You can then specify the appropriate volume ID with the “-V” argument to the “ostor-s3-admin” command.
Another common error that you can run into is something along the lines of:
Request failed due to internal error
Command=list-user-accounts failed with error=8(Requested object not found)
Although the exact message that you receive will vary depending upon the command that you are trying to run.
This error is caused by not specifying a user account to execute the command as. I resolved this by grabbing the main admin account user ID from the ACI/VHI S3 admin web interface and passing that with the “-i” argument.
Alternatively you can use “-e” instead of “-i” and pass the email address of the user account that you want to run the command as.
Another rather vague and unhelpful error message that you may receive from “ostor-s3-admin” is:
Bad user management cmd
This actually means that you have the arguments before the command – the “ostor-s3-admin” utility expects to receive the command (e.g. “list-user-accounts” or “list-all-buckets“) before the arguments such as the volume ID and user ID/email.
So for example the full commands should be run as:
ostor-s3-admin list-all-buckets -V volumeid -i userid
Or:
ostor-s3-admin delete-bucket -V volumeid -i userid -b bucketname
Obviously you will need to replace “volumeid“, “userid” and “bucketname” with the respective values.
The “delete-bucket” command is a very handy one that seems to be missing from a lot of the ACI/VHI S3 documentation – it will delete the specified bucket along with all of the contents, unlike the admin web interface which expects you to empty the bucket yourself first. This does however take a very long time to run on large buckets.