[libvirt] How to stop libvirt from deleting tap device after shutdown

Hi. I am currently setting up a new server machine which will host several kvm's managed largely by libvirt. The network setup though is done prior to libvirtd startup and shouldn't be touched by it. So currently everything works just fine with 0.6.0 except that libvirt deletes the tap device after I shut a kvm machine down which is something I naturally don't want. I looked through all the documentation I could find but I could not come up with a solution. Forgot to mention: all kvm machine are connected through a tap device with no bridge or whatsoever but 1:1 NAT. This done for performance reasons. As model I use "virtio". Any help would be greatly appreciated. Best regards, Matthias Dahl = XML File for one of the machines =========================================== <domain type='kvm'> <name>charon</name> <uuid>08a3af0e-f145-54c6-30a2-efdab5478523</uuid> <memory>2097152</memory> <currentMemory>524288</currentMemory> <vcpu>1</vcpu> <os> <type arch='x86_64' machine='pc'>hvm</type> <boot dev='hd'/> </os> <features> <acpi/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='file' device='disk'> <source file='/dev/diskspace/kvm_charon'/> <target dev='vda' bus='virtio'/> </disk> <interface type='ethernet'> <mac address='52:54:00:25:6f:3f'/> <script path='/bin/true'/> <target dev='charon_pvnet1'/> <model type='virtio'/> </interface> <serial type='pty'> <source path='/dev/pts/1'/> <target port='0'/> </serial> <console type='pty' tty='/dev/pts/1'> <source path='/dev/pts/1'/> <target port='0'/> </console> </devices> </domain>

On Mon, Mar 02, 2009 at 03:15:17PM +0100, Matthias Dahl wrote:
Hi.
I am currently setting up a new server machine which will host several kvm's managed largely by libvirt. The network setup though is done prior to libvirtd startup and shouldn't be touched by it.
So currently everything works just fine with 0.6.0 except that libvirt deletes the tap device after I shut a kvm machine down which is something I naturally don't want. I looked through all the documentation I could find but I could not come up with a solution.
Forgot to mention: all kvm machine are connected through a tap device with no bridge or whatsoever but 1:1 NAT. This done for performance reasons. As model I use "virtio".
<interface type='ethernet'> <mac address='52:54:00:25:6f:3f'/> <script path='/bin/true'/> <target dev='charon_pvnet1'/> <model type='virtio'/> </interface>
With type='ethernet' libvirt doesn't have anything todo with TAP device management, leaving it upto QEMU, and any script you configure. libvirt only creates/deletes TAP devices when using type=bridge or type=network. So I think it is probably QEMU itself that's killing off your pre-created TAP device, rather than libvirt. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (2)
-
Daniel P. Berrange
-
Matthias Dahl