10

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?

holms
  • 1,464
  • 7
  • 20
  • 37
  • I proposed a documentation patch to document how to start the 'default' network if it isn't running: https://review.openstack.org/44784 – Lorin Hochstein Sep 03 '13 at 02:57

6 Answers6

15

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

9

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

Chux Uzoeto
  • 428
  • 4
  • 8
8

List available networks and specify the one you need:

virsh net-list

You can use virt-manager GUI too.

GioMac
  • 4,444
  • 3
  • 24
  • 41
  • 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 '13 at 13:34
  • p.s. RDO/Openstack is quite complicated system, it puts all the data to it's db, etc – GioMac Aug 28 '13 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: http://libvirt.org/sources/virshcmdref/html/sect-net-create.html – GioMac Aug 28 '13 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 '13 at 13:46
1

You can start the default network by doing:

virsh net-start default
Lorin Hochstein
  • 4,868
  • 15
  • 54
  • 72
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
Jonathan
  • 111
  • 2
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.

andrew.n
  • 130
  • 3