In oVirt 3.4 we extended the integration with Glance, allowing to import Glance images of type QCOW2 or RAW as oVirt templates.
When importing an image you can do one of the following:
- Import the image as a disk - useful when you want to take an image and attach it to a VM
- Import the image as a template - useful when you would like to take existing image from Glance and use that in order to create several VMs
We also added a public Glance repository to be used by oVirt deployments. A reference to this repository is automatically added in 3.4, so you'll see it in the UI by default, under the name "ovirt-image-repository". You can either use it, or add your own Glance provider, using the steps outlined below.
The public repository currently contains a small amount of images, but we hope to add more images in the near future.
Setting it upIn this section I assume you already have an active Data-Center and Cluster. The DC level should be 3.4 and above for the import and VM creation to work.
Using Glance from within oVirt is pretty easy. If you plan to use the public repository, then all you have to do is:
- Go to the Storage main tab
- Select the "ovirt-image-repository" domain
- In the images sub-tab you'll see a list of available images
- Select an image
- Press Import
- Select Data-Center, Storage domain and Quota (I'm not using Quota so it is disabled)
- Check the "import as template" checkbox
- Select a Cluster
- Press OK
|Storage Main Tab|
|Selecting an Image|
|Import Image Dialog|
Then you'll see that there is a new task running:
Once finished, a new template was created, with default configuration, name that starts with "GlanceTemplate", and description that contains the original image name:
|Template Main Tab|
You can rename it, and change different properties in it, and then use it as any other template, in order to create new VMs. Before use you should also change the OS type of the template, according to the selected image. The OS type determines whether you can use cloud-init on the VM or not. The current images are cloud-images, so you'll need to use the integration with cloud-init in order to be able to login/connect to the VM. In order to do that you need to change the OS type of the template, and in case of linux based OS you'll have the option to use cloud-init when adding VMs.
Adding your own Glance providerIn the steps above I used the public Glance repository, which exists by default in 3.4 deployments. You can also add a reference to your own Glance instance. If your instance doesn't allow anonymous read-only access, then you also have to configure the Keystone details in the oVirt engine, so let's do that first:
- Open a shell in the server where the engine is installed
- Enter the command:
- Restart the oVirt engine
- In the Tree on the list, select the External Providers branch
- Press Add
- Fill in the details
- If your provider requires authentication then select "requires authentication", and fill in the relevant credentials
- Press Test-Connection to check that the provided details are correct
- Press OK
|Provider Main Tab|
- As I wrote earlier, we only supports RAW and QCOW2 images
- We currently don't support SSL communication with Glance
- The import of these templates and the usage of them is only supported on DC Level 3.4 and above
- The Fedora and CentOS images that exist in the public repo are cloud-images, and designed to be initialized using cloud-init. For more information about cloud-init integration in oVirt have a look at Cloud-Init integration and Persistent VM init data
- As stated above, import as a template work only on Data-Centers with compatibility level that's 3.4 and above. Currently we also allow that on 3.3, but that's a bug, as the template will be created, but you won't be able to create VMs from it. This will be addressed in 3.4.1.