Hey all,<div><br></div><div>I'm currently working on supporting OpenVZ through the libvirt driver in Nova.</div><div>I can successfully spin up and tear down OpenVZ containers using a slightly</div><div>modified version of devstack (yay!), but I've come across an issue with the</div>
<div>networking part of it that I could use some advice on from libvirt experts out</div><div>there.</div><div><br></div><div>When my containers are spawned, they do not have their networking</div><div>setup completely. I have to manually use vzctl to set the IP address:</div>
<div><br></div><div>  sudo vzctl set 101 --ipadd 10.0.0.2 --save</div><div><br></div><div>I need to do the same for the nameserver and hostname. Nova generates</div><div>this libvirt XML for the container's network interface:</div>
<div><br></div><div><div>    <interface type="bridge"></div><div>      <mac address="fa:16:3e:3c:0a:29"/></div><div>      <source bridge="br100"/></div><div>      <filterref filter="nova-instance-100000001-fa163e3c0a29"></div>
<div>        <parameter name="IP" value="10.0.0.2"/></div><div>        <parameter name="DHCPSERVER" value="10.0.0.1"/></div><div>        <parameter name="PROJNET" value="10.0.0.0"/></div>
<div>        <parameter name="PROJMASK" value="255.255.255.0"/></div><div>      </filterref></div><div>    </interface></div></div><div><br></div><div>I'd obviously like to avoid making calls 'vzctl' to finish setting up the</div>
<div>networking, so if it can be done by modifying the libvirt XML, I'd like</div><div>to do that, but can't seem to figure it out, and don't want to break</div><div>functionality by making stupid changes. I don't consider myself to</div>
<div>be either a libvirt or OpenVZ expert.</div><div><br></div><div>I did get an XML configuration like this automagically set the</div><div>IP address:</div><div><br></div><div><div>    <interface type="ethernet"></div>
<div>      <mac address="fa:16:3e:3c:0a:29"/></div><div>      <ip address="10.0.0.2"/></div><div>    </interface></div></div><div><br></div><div>However, I don't know if this will break anything if I change Nova</div>
<div>to output this for OpenVZ.</div><div><br></div><div>So, any advice from libvirt experts?</div><div><br></div><div>-Dave</div>