Registering OpenVZ 7 OS Templates via API
To register OpenVZ 7 OS template in Cloud Infrastructure Automation, do the following:
-
Register the required OS template in the Instance Manager:
cat <<EOF | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <template osType="linux-free" technology="CT" default="true" name-on-hn="centos-7-x86_64" virtualization-technology="ovz7" root-login="root" pwd-regex="[0-9]{3}[a-z]{3}[A-Z]{3}" min-hdd-size="1" low-watermark-for-delivery="80" high-watermark-for-delivery="90" name="centos-7-x86_64-ovz7" active="true"> <option name="arch" value="x86_64"/> <option name="version" value="7"/> <option name="edition" value="centos"/> </template> EOF curl -u admin:<admin_API_key> -X POST -H "Content-Type: application/xml" -d @- http://<IM_IP_address>:4465/paci/v1.0/template
-
Register the OS template on the node:
curl -u admin:<admin_API_key> -X POST http://<IM_IP_address>:4465/paci/v1.0/template/centos-7-x86_64-ovz7/register-at/openvz.local
Unregistering OpenVZ 7 OS Template from Cloud Infrastructure Automation
To unregister OpenVZ 7 OS template from Cloud Infrastructure Automation, do the following:
-
List all OS templates and find the one that you want to delete from Cloud Infrastructure Automation:
curl -u admin:<admin_API_key> -X GET https://c2u-web:4465/paci/v1.0/template
-
Delete the desired OS template by defining its name in the request:
curl -u admin:<admin_API_key> -X DELETE https://c2u-web:4465/paci/v1.0/template/centos-7-x86_64-ovz7