1

KVM start failing after I have made the below changes.

Environment:-

qemu-img version 2.1.3
ubuntu VM
1. Stop the VM
2. qemu-img resize vm1.img +50G
3. start the VM
virsh start vm1
error: failed to get domain 'vm1'
error: Domain not found: no domain with matching name 'vm1'

To resolve this issue, I have tried to reload using systemctl reload libvirtd but still results the same problem.

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 4     vm10                         running
 5     vm-test                      running
 6     vm11                         running
 16    vm12                         running
 18    vm1                          running

When i tried to connect vm1 terminal session using below command. after pressing enter key, no response.

# virsh console vm1
Connected to domain vm1
Escape character is ^]

Need help to resolve this issue.

user4948798
  • 115
  • 4
Ekam
  • 11
  • 4
  • Please, show `virsh list --all`. Also, *how exactly* did you stop the VM, and *how exactly* it was createted/defined before? – Nikita Kipriyanov Jul 07 '22 at 06:00
  • To stop used `virsh shutdown vm1` and it was created using `virsh create vm1.img` – Ekam Jul 07 '22 at 09:44
  • Are you sure? When you create VMs with libvirt's `virsh create`, you give it a definition in XML form, not a disk image file. Also I don't see a list of VMs that are currently defined in your system which I asked for. – Nikita Kipriyanov Jul 07 '22 at 11:28
  • After running `virsh define /var/vm1.xml` i am able to start the VM successfully, but i am unable to login using command `virsh console vm1` , could you help to fix this problem – Ekam Jul 08 '22 at 08:56
  • where can i see the logs to check whether vm1 is started or not. – Ekam Jul 08 '22 at 11:50
  • You use `virsh list --all` to see all defined VMs, both running and stopped. I suggested to to add output from this command from the very beginning. Logs are in the `/var/log/libvirt`. By the way, the fact your VM was defined from the file `vm1.xml` does not necessarily mean that it has the name `vm1`. The VM will have whichever name is set in that file `vm1.xml` in the body of the XML tag `...`, and it is the name which should be used in all `virsh` commands, also it will be logged with that that name. – Nikita Kipriyanov Jul 08 '22 at 13:22
  • server:~ # virsh list --all `18 vm1 running` var/log/libvirt/qemu# vm1.log `2022-07-06 09:25:51.311+0000: shutting down 2022-07-07 05:33:14.360+0000: starting up LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin QEMU_AUDIO_DRV=none /usr/bin/qemu-kvm -name vm1 -S -machine pc-i440fx-2.1,accel=kvm,usb=off -cpu host -m 32768 -realtime mlock=off -smp 4,sockets=4,cores=1,threads=1 -uuid 25da0d89-4249-41ae-baab-5282d1531ef7` – Ekam Jul 09 '22 at 07:34
  • So, your VM is running. And there is nothing wrong in logs. But information like this should be added into the question by [editing](https://serverfault.com/posts/1104942/edit) it, rather than put into comments. // So, we see your domain seems to be running. You can also check that by running `ps -aux | grep vm1`, something like this, you'll see the pid under which the Qemu process runs. So, what problems do you still have? – Nikita Kipriyanov Jul 09 '22 at 17:02
  • I am unable to login to vm1 , after giving this command 'virsh console vm1' & press enter it's hanging – Ekam Jul 10 '22 at 02:51
  • No it works. To have a login shell on that console a VM should be configured to output something there: at least, you need to add a virtual UART port into your VM configuration and start a getty on in the VM OS (where it appears as /dev/ttySx). – Nikita Kipriyanov Jul 10 '22 at 17:35

0 Answers0