Unable to create guest VM using virt-install

Bug #1301598 reported by Namu
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Expired
High
Unassigned
virtinst (Ubuntu)
Expired
High
Unassigned

Bug Description

Working in Ubuntu 14.04 (Trusty Tahr), running libvirt version 1.2.1.

root@srvr-931:~# virt-install --name nam --ram 4096 --disk path=/var/lib/libvirt/images/nam.img,bus=virtio --import --noautoconsole --network network:default,model=virtio

Starting install...
ERROR Connection is closed
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start nam
otherwise, please restart your installation.
root@srvr-931:~# virsh --connect qemu:///system start nam
error: failed to get domain 'nam'
error: Domain not found: no domain with matching name 'nam'

I see this in virt-install.log -

[Wed, 02 Apr 2014 07:26:55 virt-install 16207] ERROR (cli:445) Connection is closed
[Wed, 02 Apr 2014 07:26:55 virt-install 16207] DEBUG (cli:448)
Traceback (most recent call last):
  File "/usr/bin/virt-install", line 636, in start_install
    noboot=options.noreboot)
  File "/usr/lib/python2.7/dist-packages/virtinst/Guest.py", line 1246, in start_install
    noboot)
  File "/usr/lib/python2.7/dist-packages/virtinst/Guest.py", line 1314, in _create_guest
    dom = self.conn.createLinux(start_xml or final_xml, 0)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 3199, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: Connection is closed
[Wed, 02 Apr 2014 07:26:55 virt-install 16207] DEBUG (cli:457) Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start nam
otherwise, please restart your installation.

I run the same command on Ubuntu 12.04.1 LTS and I don't see any problem there. This looks very similar to Bug#1180281, but I don't see a solution there. Does anyone know if this is fixed now? And the versions that I need to use?

Thank you!

Tags: libvirt
Namu (nkothap)
tags: added: libvirt
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

You did not include "--connect lxc:///" in your command, so virsh connected to the qemu driver.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Please see
https://www.berrange.com/posts/2013/08/12/running-a-full-fedora-os-inside-a-libvirt-lxc-guest/
for an example of how to use virt-install with livirt-lxc.

Changed in libvirt (Ubuntu):
status: New → Invalid
Revision history for this message
Namu (nkothap) wrote :

I'm confused by your comment.

Why do I need to "--connect lxc:///" to connect to qemu driver?

Why do I not need this in Ubuntu 12.04.1 LTS?

I can run this command: "virt-install --name nam --ram 4096 --disk path=/var/lib/libvirt/images/nam.img,bus=virtio --import --noautoconsole --network network:default,model=virtio" in Ubuntu 12.04 and create a VM.

I don't get how this is related to LXC!

Per your comment, I did try the following -

root@srvr-931:~# virt-install --connect lxc:/// --name nam --ram 4096 --disk path=/var/lib/libvirt/images/nam.img,bus=virtio --noautoconsole --network network:default,model=virtio --force

Starting install...
Creating domain... | 0 B 00:00
Domain creation completed. You can restart your domain by running:
  virsh --connect lxc:/// start nam

root@srvr-931:~# virsh --connect lxc:/// start nam
error: Domain is already active

root@srvr-931:~# virsh list --all
 Id Name State
----------------------------------------------------

Changed in libvirt (Ubuntu):
status: Invalid → New
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Hm, sorry! I thought the subject of the bug said lxc. In that case, confirmed.

Changed in libvirt (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Hi,

can you still reproduce this bug?

Changed in virtinst (Ubuntu):
status: New → Incomplete
Changed in libvirt (Ubuntu):
status: Confirmed → Incomplete
Changed in virtinst (Ubuntu):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for virtinst (Ubuntu) because there has been no activity for 60 days.]

Changed in virtinst (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for libvirt (Ubuntu) because there has been no activity for 60 days.]

Changed in libvirt (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.