On 03/06/15 09:15, Robie Basak wrote:
Hi Michael,

(uvtool author here)

On Tue, Jun 02, 2015 at 09:30:15AM +0100, Michael Foord wrote:
In order to specify a MAC address for a KVM image we need to create a
libvirt domain xml template to pass as the template argument to uvt-kvm.
Right.

Ideally we'd like to specify as *little as possible* in the template and
have the generated libvirt xml (i.e. the created image) be identical to what
uvt-kvm would have created for us without the template. The only change
being that the image will have a network interface with the MAC address we
specify.

Attached are two xml files. "juju-bare-metal.xml" is the *generated* xml
(using master) for a kvm image on MAAS bare metal (functionally the same as
the xml we generate for a kvm image in a kvm image - I checked).
"template.xml" is the minimal template I found that would cause uvt-kvm to
generate the same image.
What you've done here is correct the best way to do it right now - I
presume you will end up generating the XML here instead of letting
uvtool do it?

We have a minimal template, specifying only what we have to, and let uvtool generate the rest from defaults and command line parameters.

Note that in addition to picking up the (usually default) template XML
file, uvtool also does some manipulation of the XML tree in response to
the other options specified (--disk, --memory, some networking options,
etc) as well as some mandatory manipulations (defining the name, for
example).
Yes, we'll still be using the command line parameters for those things. We'd like to hardcode as little as possible in the XML for the reasons you describe.

One catch is that if things change in the future, Juju (by hardcoding
the XML default) will be stuck in the past. For example, I think there
are some changes in the pipeline where supporting different
architectures such as ppc64el and arm64 require slightly different
optimal XML definitions.

How about I add an option to allow you to set the MAC address from the
command line? This would only apply to >= Wily, but older releases
aren't set to change anyway. For future releases, if you used that
option, then you'd get what you need but also be able to stick to
default XML handling.

The catch is that you'll need to implement it both ways - but the
implementation to add the command line option would presumably be pretty
small.

How does that sound?

That would be great! We're happy to use XML generation as a fallback for older versions of uvtool.

At some point in the not too far future we'll need to support multiple NICs (each with a MAC address and bridged to a different network on the host), so if you could bear that use case in mind that would also be great...

Many thanks,

Michael Foord

Robie



-- 
Juju-dev mailing list
Juju-dev@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju-dev

Reply via email to