[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] xml format for openvz driver

I just want to summarize
XML for OpenVZ will looks like

<domain type='openvz'>
                <filesystem type="template">
                        <source name="fedora-core-5-i386" />
                        <quota type="size" max="10000"/>
                        <quota type="inodes" max="200000"/>

                <interface type='bridge'> //for bridge
	                <source bridge='eth10'/>
                        <mac address='00:16:3e:5d:c7:9e'/>

                <interface type='bridge'> //for NAT
	                 <source bridge='eth11'/>
	                 <target type='network'>
                                 <source network='default'/>

                <interface type='network'> //for phisical device
	                 <host class='network' dev='eth1'/>

                <interface type='route'> //for routing network
	                 <mac address='00:16:3e:34:21:9e'/>
                         <ip address="" />
                         <ip address="" />


Please, correct if it is necessary.

On Wed, Jul 23, 2008 at 01:33:25PM +0400, Evgeniy Sokolov wrote:
On Tue, Jul 22, 2008 at 08:41:36PM +0400, Evgeniy Sokolov wrote:
For tag domain/devices/interface:
How to describe, if want to add ip addresses for routing network?
We'll probably want todo something based on <interface type='ethernet'
which is a generic catch all config.

Does OpenVZ support bridging, or NAT for containers ?
bridging is supported.
NAT can be configured via iptables.
If it supports bridging that is sufficient. The libvirt networking
APIs, allow us to implement NAT for any VM in terms of the generic
bridge support. Basically libvirt creates a bridge device 'virbr0'
and sets up NAT rules for that device. A guest VM simply needs to
be connected to virbr0, and then NAT automagically works for it.
Do I correctly undertand? For NAT we shoud use tag "interface" with type
"bridge" and
<target dev="virbr0" />

No, you'd have something like

   <target type='network'>
      <source network='default'/>

And inside your driver you will call  virNetworkLookupByName(...)
and then virNetworkGetBridge() to find the actual bridge device name.
Take a look at the QEMU driver 's qemudNetworkIfaceConnect() method
and how it deals with VIR_DOMAIN_NET_TYPE_NETWORK vs the alternative


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]