Open ondrejbudai opened 2 years ago
Blocking issue for us too, can't start vm on arm. @dmacvicar there is a chance to push it? Or maybe even just add option to set "bus" param for disk?
Blocking issue for us too, can't start vm on arm. @dmacvicar there is a chance to push it? Or maybe even just add option to set "bus" param for disk?
That option can't be evaluated until we understand if virtio can be used in both cases. There is not reason to make things more complicated or configurable just in case.
Would the example in https://github.com/dmacvicar/terraform-provider-libvirt/pull/895#pullrequestreview-780284017 work in both architectures?
Not sure i got right what you meant. What i tried is to set bus of cdrom to virtio and this option is not supported not in x86 neither in arm arm : error: unsupported configuration: disk type 'virtio' of 'hda' does not support ejectable media error: unsupported configuration: virtio disk cannot have an address of type 'drive'
@tsorya if you look at the example I pasted above, from cloud-init documentation one derives there is no need for a CDROM. Just a disk with the right label, and this disk can be virtio (at least in the example it is).
@dmacvicar adding iso as disk with virtio works. Though it creates inconsistency with x86. IMO same terraform file should work with arm and with x86 and it is nice to have a cdrom too.
Why? x86 works with disk too.
Hello, I can report that it seems the same issue arises not only on aarch64 but on x64 as long as OVMF is involved: apparently there is a detection issue with IDE at first boot and one need to either use SCSI or reboot once to trigger proper commoninit execution.
That may play in favor of exploring virtio solution rather than having to deal with a multiple case/switch sort of situation? I am not too well-versed in go, but I can probably test something if one comes up with a patch.
I ran in to this issue as well and tested with Ubuntu cloudimg (using UEFI).
cloudinit
in the libvirt_domain
does not work, as it uses ide
as bus type for the CDROMdisk
pointing to the same .iso file - same result (it automatically creates a CDROM with bus ide
)
sata
However, when using a vfat
disk image with the right label, it works without patching the bus:
imgfile=/var/lib/libirt/images/cidata.img
dd if=/dev/zero of=$imgfile bs=1M count=2
mformat -i $imgfile -v cidata
mcopy -i $imgfile cloud_init.cfg ::user-data
mcopy -i $imgfile network_config.cfg ::network-config
touch meta-data
mcopy -i $imgfile meta-data ::meta-data
mdir -I $imgfile
and reference it as a normal disk
disk {
file = "/var/lib/libvirt/images/cidata.img" # vfat
}
I played with this provider on aarch64 and I found out that cloud-init doesn't work there. Two fixes are needed:
I successfully tested this change with the following terraform file:
If you are looking for a quick workaround for this issue, you can also use this following xslt (also tested):