Hammer oVirt image build - cannot add virtual disk, VM already marked as boot

Problem:
I am running Foreman 2.3.1 and oVirt 4.3.10.

When running hammer to create a VM on oVirt using an oVirt image, hammer creates the VM on the same volume as the oVirt image. In the Foreman UI I can change the VM volume before submitting the create VM request but I cannot do so using hammer. Using hammer all oVirt VMs are created on the same volume as the oVirt image. I do not have this issue on VMs created by hammer on VMware. In VMware I can add the volume to use in the “Compute Profile”. I cannot find a “Compute Profile” that works in oVirt to change the volume.

The following hammer command creates the VM on the volume where the oVirt image is stored. In this case the “Compute Profile” does not have a volume set. Foreman uses the volume from the oVirt image.

hammer host create --name “test” --compute-attributes “cores=1, socket=1, memory=4294967296, cluster=CLUSTER1, start=1” --hostgroup “CentOS_7_oVirt” --image “centos7-image” --interface “compute_network=CLUSTER1, managed=1, primary=1, provision=1, type=interface” --ip “192.168.1.1” --location “Default Location” --operatingsystem “CentOS_7_oVirt” --organization “Default Organization” --provision-method “image”

I tried adding a volume to the “Compute Profile” as bootable. I thought the OS would be installed on this volume but hammer failed with the following error.

Could not create the host:
Failed to create a compute CLUSER1_Compute_Resource (oVirt) instance testvm: Fault reason is “Operation Failed”. Fault detail is “[Cannot add Virtual Disk. Disk Disk1 in VM testvm is already marked as boot.]”. HTTP response code is 409.

In the following URL the interesting part to me was the user was able to specify the “bootable=true” on one of the volumes. I tried that too using hammer and got the same already marked as boot error. The user is running an older version of Foreman and oVirt.

Hammer CLI, oVirt and templates

I have not been able to find a solution. Are there any suggestions? Thanks.

Foreman and Proxy versions:
Foreman 2.3.1

Distribution and version:
CentOS 7.8

Other relevant data:
oVirt 4.3.10

The issue has been resolved. In the Compute Profile for oVirt the Template, Storage domain, and Preallocate disk have to be set. The OS disk will be placed on the Storage domain of the Compute Profile when hammer is used to create the oVirt VM.

In the previous configuration the Template was set to a “Blank Template” and hammer was used to select the Template at build time. Foreman would create the oVirt VM as a linked clone on the same storage as the template.

The behavior is different when using the Compute Profile for VMware where the Template and Storage can be selected by hammer at build time.

1 Like