virt-install can't find existing network

Bug #1177261 reported by julian wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
virtinst (Ubuntu)
New
Undecided
Unassigned

Bug Description

After created network with non-root user, virsh can find those networks by same user, but virt-install can not.
Anyway, virt-manager can create VM with network 'management'.

$ sudo dpkg -l | grep virtinst
ii virtinst 0.600.1-1ubuntu3.2 Programs to create and clone virtual machines
$ sudo dpkg -l | grep libvirt-bin
ii libvirt-bin 0.9.8-2ubuntu17.8 programs for the libvirt library
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise

$virsh net-list
Name State Autostart
-----------------------------------------
api active yes
data active yes
external active yes
management active yes

$virsh net-dumpxml management
<network>
  <name>management</name>
  <uuid>48ca41b6-86b0-677b-80f2-155e67dd280a</uuid>
  <forward mode='nat'/>
  <bridge name='virbr1' stp='on' delay='0' />
  <mac address='52:54:00:AF:AD:E3'/>
  <ip address='192.168.124.1' netmask='255.255.255.0'>
  </ip>
</network>

$/usr/bin/virt-install -n bootstrap -r 2000 --vcpus=1 --disk /vms/bootstrap.img,size=20,bus=virtio,cache=writeback --cdrom /iso/ubuntu-server-12.04.iso --vnc --noautoconsole --os-type linux --accelerate --network=network=management,model=virtio -d

[Tue, 07 May 2013 15:24:20 virt-install 12408] DEBUG (cli:220) Launched with command line:
/usr/bin/virt-install -n bootstrap -r 2000 --vcpus=1 --disk /vms/bootstrap.img,size=20,bus=virtio,cache=writeback --cdrom /iso/ubuntu-server-12.04.iso --vnc --noautoconsole --os-type linux --accelerate --network=network=management,model=virtio -d
[Tue, 07 May 2013 15:24:20 virt-install 12408] DEBUG (cli:326) Requesting libvirt URI default
[Tue, 07 May 2013 15:24:20 virt-install 12408] DEBUG (cli:328) Received libvirt URI qemu:///session
[Tue, 07 May 2013 15:24:20 virt-install 12408] DEBUG (virt-install:259) Requesting virt method 'default', hv type 'default'.
[Tue, 07 May 2013 15:24:20 virt-install 12408] DEBUG (virt-install:469) Received virt method 'hvm'
[Tue, 07 May 2013 15:24:20 virt-install 12408] DEBUG (virt-install:470) Hypervisor name is 'kvm'
[Tue, 07 May 2013 15:24:21 virt-install 12408] ERROR (cli:439) Error in network device parameters: Virtual network 'management' does not exist: Network not found: no network with matching name 'management'
[Tue, 07 May 2013 15:24:21 virt-install 12408] DEBUG (cli:440)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/virtinst/cli.py", line 884, in get_networks
    dev = parse_network(guest, netstr, mac=mac)
  File "/usr/lib/python2.7/dist-packages/virtinst/cli.py", line 1642, in parse_network
    bridge=opts.get("bridge"))
  File "/usr/lib/python2.7/dist-packages/virtinst/VirtualNetworkInterface.py", line 153, in __init__
    self.network = network
  File "/usr/lib/python2.7/dist-packages/virtinst/XMLBuilderDomain.py", line 309, in new_setter
    fset(self, val, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/virtinst/VirtualNetworkInterface.py", line 254, in set_network
    % (newnet, str(e)))
ValueError: Virtual network 'management' does not exist: Network not found: no network with matching name 'management'

Revision history for this message
Alexander Kupko (akupko) wrote :

Specifying hypervisor connection URI for virt-install will solve this issue:

/usr/bin/virt-install --connect qemu:///system -n bootstrap -r 2000 --vcpus=1 --disk /vms/bootstrap.img,size=20,bus=virtio,cache=writeback --cdrom /iso/ubuntu-server-12.04.iso --vnc --noautoconsole --os-type linux --accelerate --network=network=management,model=virtio -d

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.