If I am using the APIs to create new VMs or clone existing ones, and I want to update the virtual disk image or download a virtual disk image for an existing VM is the NFS mount the correct/preferred way to do this or is there another API to do this through the image service? I see APIs in the old REST API for images, but it is not clear how to determine the upload/download URLs.
Also, is it possible to access the same image conversion functionality that the image service provides from the Prism UI so images can be uploaded in a compressed format?
Best answer by ckousoulis
Both of the options you discussed go through the Image Service, so you can transfer a qcow2 either way and let the Image Service unpack it.
The only difference is in the requirement from the API client. Transfering a disk to the Image Service from a URL accessible to the cluster is as easy as one POST with the appropriate URL parameter in the body. Transferring a disk to the Image Service from a local file (that you aren't serving in any way) is a POST (to create the image metadata) followed by a PUT at /upload URL to stream the bytes (in this case the API client participates in the image transfer). As an example, the Prism UI sets a DOM File object as the 'data' in the body of the PUT and specifies a 'contentType' of 'application/octet-stream'. The browser handle the rest, but we can help you author a non-browser app that has this behavior. I'll try and locate some sample code.