12

My original purpose is to create centos image for openstack. Although I did directly with kvm, still wondering about error.

Was using this manual for my task.

After this command:

# virt-install --virt-type kvm --name centos-6.4 --ram 1024 \
--cdrom=/data/isos/CentOS-6.4-x86_64-netinstall.iso \
--disk /tmp/centos-6.4.qcow2,format=qcow2 \
--network network=default \
--graphics vnc,listen=0.0.0.0 --noautoconsole \
--os-type=linux --os-variant=rhel6

I got an error:

ERROR    Error in network device parameters: Virtual network 'default' does not exist: Network not found: no network with matching name 'default'

Needless to say that I'm using RDO. By default I don't have any pre-configured network devices for libvirt. Question is which networking devices are available? Or if there's none, how to create one? Maybe RDO has different approach on libvirt networking?

1

7 Answers 7

8

List available networks and specify the one you need:

virsh net-list

You can use virt-manager GUI too.

4
  • seems to be there's no any in there.. how can I add one..? RDO seems to be using bridge interface. actually launching this container directly from qemu it works. Wondering why it's not working for virsh.
    – holms
    Aug 28, 2013 at 13:34
  • p.s. RDO/Openstack is quite complicated system, it puts all the data to it's db, etc
    – GioMac
    Aug 28, 2013 at 13:34
  • 2
    virt-install uses libvirt, if virsh doesn't show you anything about it, then it wont do anything. you can create network with virt-manager, or virsh net-create: libvirt.org/sources/virshcmdref/html/sect-net-create.html
    – GioMac
    Aug 28, 2013 at 13:36
  • 1
    ok i've changed network option with this and it's working --network=bridge=br100,mac=22:44:66:EE:EF:1F specified my bridge device which was created by RDO, and random mac address. not sure if internet will work inside vm, but I need virsh only for using virt-sysprep tool
    – holms
    Aug 28, 2013 at 13:46
17

list files in

/etc/libvirt/qemu/networks/

and

/etc/libvirt/qemu/networks/autostart/

if empty - create it

useful commands:

virsh net-start default

or

virsh net-autostart default

and

virsh net-destroy default
virsh net-undefine default
service libvirtd restart

for detailed explanation read wiki: http://wiki.libvirt.org/page/Networking

10

This is actually expected behaviour it seems .. something to do with how NAT forwarding is set-up by default. The system expects a 'default' network, bound to virbr0. So, if you delete that network, virt-install would no longer run as expected.

You probably can work around this if you are willing to poke around the innards of libvirt config files, and modify all relevant configuration file defaults. The error message can also be made more useful and explanatory ..

To recreate the network, first move off the network currently assigned to virbr0, and then:

# virsh net-define /usr/share/libvirt/networks/default.xml
Network default defined from /usr/share/libvirt/networks/default.xml
# virsh net-autostart default
Network default marked as autostarted
# virsh net-start default
Network default started`

Of course, you can also recreate the 'default' network via the virt-manager or other GUI ..

See more details here

0
1

You can start the default network by doing:

virsh net-start default
1

Simply requires, as above:

yum install libvirt-daemon-config-network

This will populate the files required... then execute the command:

virsh net-list

...then if the network isn't active

virsh net-start default
0

You may be missing the libvirt-daemon-config-network RPM. It doesn’t seem to be a dependency of the main packages you need to install to get KVM running.

Try installing it and trying again.

0

I believe that root user has the default interface.

sudo virsh net-list

But it depends on your permission policy, consider the combination of these below.

  1. https://serverfault.com/a/555654/988766
  2. https://serverfault.com/a/590617/988766

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .