Upload image using xmlrpc

Hi all!!
does anyone can explain how to upload an image using xmlrpc?
what is the xmlrpc equivalent of

`oneimage create --name "tty" --path "/home/user/ttyvd-context.qcow2" --driver qcow2 --datastore default`

I have to upload this image from my hard disk, define a vm and launch it… all this must be done via xmlrpc

it is possible?

Thank you!!

Of course it’s possible, the CLI uses xmlrpc to talk to OpenNebula.

You just need to replicate what the CLI and ruby OCA are doing.
The code you need to look at is in src/oca/ruby and src/cli.

1 Like

Hi Paolo,

Note that this path have to be available in the machine where oned is running.

Otherwise, you have to find a way to move that file there. You can also provide an http url as the path of the image and OpenNebula will download it. Therefore, you can deploy an HTTP server in your machine and provide the url of the file.

1 Like

Isn’t there a way to upload directly?

You can upload images from Sunstone but I would not recommend it for big files.
I would expose the image in an HTTP server and provide an url as the path of the Image.

yes…It’s exactly what I have been doing so far :grin:

Thank you!!