Fixes #13778 - Libvirt cloud-init provisioning fails #3205
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When you try to boot a VM with libvirt and cloud-init provisioning,
libvirt will make a initial .iso file to be provided during the VM
booting process.
This .iso file is created wherever the main volume for the VM is
created (storage-pool-path/cloud-init-data.iso).
Fog-libvirt sets iso_dir for all VMs to '/var/lib/libvirt/images'
as the default location to fetch the cloud-init .iso.
Foreman will try to use this directory when creating the VM as the
location for cloud-init.
However, that may not be right if the storage-pool is not the
default one. In my case, I run my libvirt VMs from an external
hard-drive, so Foreman needs to understand the iso_dir will be the
external hard-drive storage pool, not the default
/var/lib/libvirt/images.
Fix is simple, just set iso_dir during the VM creation process.