How to add your own vm image to your G8
Image management is normally done through meneja.gig.tech. This is the proper way to do it, because meneja will test if your image works properly before making it available to the G8's, plus it also handles the distribution to the G8's that are subscribed to it.
Sometimes you just want to test a vm image, which is why you can just make it available on one of your G8's
Uploading an image to a G8 is possible via the CloudApi.
Go into the portal of your G8 and click the "Machine API" in the top of the screen:
In the cloudapi_images section you will find the "Create a image from a url":
You can use this API browser to actually invoke the API. Provide values for the following fields:
- Required fields:
- name: The name for the vm image
- url: The URL from which the G8 can download the qcow2 disk image
- gid: The global id of your G8. You can get this value by listing the locations api in the cloudapi_locations section of the API browser
- boottype: The boot type of the vm image. Possible values are:
- memory: The minimum amount of memory for vms created by this image in MiB.
- bootDiskSize: The minimum size of the boot disk for vms created by this image in GiB.
- addMemory: Flag that indicates whether vms created of this vm image support adding memory while the vm is running.
- addVCPU: Flag that indicates whether vms created of this vm image support adding virtual cores while the vm is running.
- removeVCPU: Flag that indicates whether vms created of this vm image support removing virtual cores while the vm is running.
- addNIC: Flag that indicates whether vms created of this vm image support adding network interfaces while the vm is running.
- removeNIC: Flag that indicates whether vms created of this vm image support removing network interfaces while the vm is running.
- imagetype: Operating system type of the vm image. Possible values are:
- Optional fields
- username: By default the G8 creates a user account in the vm with username user via cloudinit. If the image only works with a very specific username then specify it here.
- password: By default the G8 generates a random password for each new vm via cloudinit. If the image only works with hardcoded password, you can specify it here.
- accountId: By default images are usable by all accounts on the G8. You can limit the availability of the image to a single account here by putting the account id. You can get the account id by listing the accounts via the accounts api in the cloudapi_accounts section of the API browser.
- tags: A free string field to store metadata along with the image registration in the G8.
When all the fields are filled execute the API call by pressing the [Try it out!] button located below the fields. If there is no error the G8 will start downloading the vm image from the url you passed.
This api call is meant to be executed assynchronously. This is not possible via the API browser, so if it takes more than 300 seconds to download the api, you will see a gateway error. Now, this does not mean that the image failed to create. Be patient and wait until it becomes available as one of the images when creating a vm in the portal.