...
Upload or download a template
Use it to create a VM
Update the template. Abiquo supports changes to:
file content
size
format
capacity
controller
Update the disk using the Appliance manager API.
When the user next deploys the VM, the platform will copy the updated disk
...
Note |
---|
The default value for the diskControllerType is "IDE" and the default value for the diskController is NULL. If your template uses a different controller, such as "SCSI" and "lsilogic", you must add these values in the diskReplace.json entity, as shown above. If you do not add them, the platform will overwrite your template with its default values. You should note that the AM API does not support all of the values that are supported by the Abiquo API. |
...
5.
...
Obtain the URLs to replace the file
...
Obtain the URLs to build the request to replace the disk.
Warning |
---|
If your file name or folder name contains spaces, do the steps below in “Steps for folder names with spaces” and “Steps for file names with spaces” to obtain the folder path, file name and URL |
The URL to post to contains the enterprise ID and the template folder in the following format.
...
The template folder is the folder path on the NFS Repository, without the file name.
So from our example that with the following “href” and “path”:
...
Code Block |
---|
/am/erepos/1/templates/1/bundle/e05785d2-b49a-4034-9bb9-3440e1693589-4ba3b6e1-6f06-47d9-8703-9e9 |
Warning |
---|
Tip |
The template path does not contain the ID of the datacenter repository. It contains the folder name from /opt/vm_repository. |
Info |
---|
If the original disk file is not available, you can create a placeholder file in the folder using the touch command, in the format touch {currentPath}. For example: |
Tip |
---|
The template path does not contain the ID of the datacenter repository. It contains the folder name from /opt/vm_repository. |
You will use this information to build the request to replace the disk.
cURL
|
Steps for folder names with spaces
The URL to post to contains the enterprise ID and the template folder in the following format.
Code Block |
---|
/am/erepos/{enterpriseId}/templates/{templateFolder} |
The template folder is the folder path on the NFS Repository, without the file name.
So for an example with the following “href” and “path”:
Code Block |
---|
"href": "{base_api_url}/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/72/disks/74"
"path": "1/bundle/abc%20def/olddisk-flat.vmdk" |
The “folder path” is as follows:
Code Block |
---|
1/bundle/abc%20def |
And the format of the URL to post to will be:
Code Block |
---|
/am/erepos/1/templates/1/bundle/abc%2520abc |
Steps for file names with spaces
If the file name contains spaces, in the cURL command, enclose the File option in quotation marks and shell escape the spaces.
For example, if the file name is new disk.vmdk
, then in the cURL command, you should use -F "diskFile=@new\ disk.vmdk"
6. Replace the disk
In the following cURL, the base_url
is the URL of the Abiquo API server, without the /api
path. For example, https://abiquo.example.com
.
...
Code Block |
---|
{ "title": "8611a4ed-adbd-49aa-a22e-81fd4b60e833-newdisk", "rel": "diskfile", "href": "http://abiquo.example.com:8009/am/files/1/bundle/e05785d2-b49a-4034-9bb9-3440e1693589-4ba3b6e1-6f06-47d9-8703-9e9/8611a4ed-adbd-49aa-a22e-81fd4b60e833-newdisk.vmdk" } { "sequence": 0, "path": "1/bundle/e05785d2-b49a-4034-9bb9-3440e1693589-4ba3b6e1-6f06-47d9-8703-9e9/8611a4ed-adbd-49aa-a22e-81fd4b60e833-newdisk.vmdk" } |
We hope that you will enjoy working with your refreshed VM template!The new disk is now ready to use in the VM template.