-
Notifications
You must be signed in to change notification settings - Fork 19
failed: TASK [Get instance(s) ip address] #47
Comments
Was there some errors earlier ? did you look at the libvirt logs ? I think it should be something like /var/log/libvirt/qemu/instance.log |
No error before No errors in Kvm log at /var/log/libvirt/qemu/instance.log Is the size of the files I posted before really correct? If you can test it in my test project: git clone [email protected]:mhagnumdw/ansible-setup-workstation.git
cd ansible-setup-workstation
git checkout libvirt-kvm
pip install virtualenv
virtualenv .venv
source .venv/bin/activate
pip install molecule ansible-core molecule-libvirt libvirt-python
molecule -vvv --debug converge # problem here!
molecule destroy Any ideas? |
Good news. I got the error in the Create cloud-init iso file task: So I set the charset in the task ( Then I saw another error in the Expand original image on the new sized volume task that the Is it worth adding a check to see if the command exists? |
Please feel free to close this issue. |
Same error occuring for me with virt-resize present ... |
@javanaut-de did you install the guestfs-tools as mentioned per @mhagnumdw ? |
@goldyfruit I did. I tried to get something to run with various parameters for some days now but no success so far. The host is running on Ubuntu 22.04. I tried some basic variations of the examples, ubuntu 20 and 22 server cloudimg and the fedora version given in the example:
Stopping a test just after creation of the VM and enabling VNC I find that the booting process stopped with the following message:
virt-df shows no partition present in the .qcow2 file. While virt-filesystems --all --long showing:
I managed to deploy some VMs sucessfully with a self-written ansible role before, so I guess I am missing something very basic here... PS: Interesting. Modifying the create.yml playbook replacing the invokation of virt-resize and handling of the temp image with a similar task using qemu-resize (loosing the image_volume param in this example) as well as increasing the timeout in task "Get instance(s) ip address" seems to work:
|
Maybe something wrong with the qcow2 ? I don't know the reason of using virt-resize instead of qemu-img but I guess that the advantage of using it is that virt-resize can also resize lvm/filesystems which can't be done with qemu-img afair. Of course, this also mean that I expect virt-resize to be really slower than qemu-img... |
With version 0.0.6 of the driver the error showed up always in the same way I think. I tried Ubuntu 20 and 22 cloud img in the first place which come as .qcow2 with file extensions .img. But also the fedora 34 cloud base img that is shown in the example configuration behaving the same. All images come as compressed qcow2 file according to "qemu-img info". virt-resize resizes contained partitions and filesystems as well, whereas leaves this task to the user. This works for my use case as the cloud img distributions seems to auto-resize the partititions on first boot. I don't know why virt-resize fails with my setup, but maybe I will find out. Could be something similar to this: https://serverfault.com/questions/976792/how-to-fix-partition-table-after-virt-resize-rearranges-it-kvm |
I have started to learn more about qemu/libvirt and to experiment a bit with the driver and some molecule scenarios. Some problems appearently correspond to permissions. For example I found virt-resize trying to read the hosts kernel image which is per default only readable for root. This prevents running VMs/performing tests under non-root user but can be resolved by allowing read acces per ACL. This can also be made persistent creating a kernel postinst script: /etc/kernel/postinst.d/qemu #! /bin/bash
setfacl -m u:<VM-User>:r /boot/vmlinuz-$(uname -r) |
Error
The virtual machine does not start.
Print
The virtual machine is stopped at boot.
Molecule vms folder
Virtual Machine xml
Click to see!
Molecule conf
Same as the README project homepage.
Versions
Molecule command
Can someone help me?
The text was updated successfully, but these errors were encountered: