lost and found ( for me ? )

KVM : create private virtual switches


# kvm --version
QEMU emulator version 1.0 (qemu-kvm-1.0), Copyright (c) 2003-2008 Fabrice Bellard

# tail -1 /etc/lsb-release
DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"


make an xml file
# cat private0.xml
<network>
 <name>private0</name>
 <bridge name="privatebr0" />
</network>

define the private0
# virsh
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
      'quit' to quit

virsh # net-define /etc/libvirt/qemu/networks/private0.xml
Network private0 defined from /etc/libvirt/qemu/networks/private0.xml

to use private0 , you need to start it.
virsh # net-list --all
Name                 State      Autostart
-----------------------------------------
default              active     yes
private0             inactive   no

start private0
virsh # net-start private0
Network private0 started

virsh # net-list --all
Name                 State      Autostart
-----------------------------------------
default              active     yes
private0             active     no


[ start private0 automatically when booting a KVM host ]

virsh # net-autostart private0
Network private0 marked as autostarted

virsh #
virsh # net-list --all
Name                 State      Autostart
-----------------------------------------
default              active     yes
private0             active     yes


symbolic files will be created under /etc/libvirt/qemu/networks/autostart directory.
# ls -l /etc/libvirt/qemu/networks/autostart/
total 0
lrwxrwxrwx default.xml -> /etc/libvirt/qemu/networks/default.xml
lrwxrwxrwx private0.xml -> /etc/libvirt/qemu/networks/private0.xml

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.