[openstack-dev] extending nova boot

Christopher Yeoh cbkyeoh at gmail.com
Sat Oct 26 10:53:17 UTC 2013


Hi Drew,

Unfortunately there's not much up to date documentation on how to write an
api extension (its on the TODO list), but as Phil mentioned looking at
existing extensions like scheduler_hints is a good place to start.

You'll need to decide whether you want to write a V2 and V3 API version of
your extension or only V3. V3 is currently marked experimental but should
(hopefully!) become the default API with the release of Icehouse. So if you
submit a V2 extension you will have to also submit a V3 version.

As Phil mentioned, for V2 you'll need to add both a new extension file,
plus modify nova/api/openstack/compute/servers.py to look for an pass the
new parameter to compute_api.create. For V2 all parameters have to be
explicitly handled in servers.py

For V3 (see nova/api/openstack/compute/plugins/v3/) you will only need to
add a new extension with no modifications to servers.py. access_ips.py is
probably a good example for V3 to see how parameters can be passed to
compute_api.create by an extension. In access_ips, see the create function
in AccessIPsController and server_create in AccessIPs. Note that you will
need to add some entries in setup.cfg for the V3 plugin to be detected.

Depending on how your extension works you may also need to add entries to
nova/etc/policy.json as well.

Regards,

Chris




On Sat, Oct 26, 2013 at 7:04 AM, Day, Phil <philip.day at hp.com> wrote:

> Hi Drew,
>
> Generally you need to create a new api extention and make some changes in
> the main servers.py
>
> The scheduler-hints API extension does this kind of thing, so if you look
> at:  api/openstack/compute/contrib/scheduler_hints.py for how the extension
> is defined, and look  in api/poenstack/compute/servers.py code for
> "scheduler_hints"   (e.g. _extract_scheduler_hints()  ) then that should
> point you in the right direction.
>
> Hope that helps,
> Phil
>
> > -----Original Message-----
> > From: Drew Fisher [mailto:drew.fisher at oracle.com]
> > Sent: 25 October 2013 16:34
> > To: openstack-dev at lists.openstack.org
> > Subject: [openstack-dev] extending nova boot
> >
> > Good morning!
> >
> > I am looking at extending nova boot with a few new flags.  I've found
> enough
> > examples online that I have a working extension to novaclient (I can see
> the
> > new flags in `nova help boot` and if I run with the --debug flag I can
> see the
> > curl requests to the API have the data.
> >
> > What I can't seem to figure out is how nova-api processes these extra
> > arguments.  With stable/grizzly bits, in
> > nova/api/openstack/compute/servers.py, I can see where that data is
> > processed (in Controller.create()) but it doesn't appear to me that any
> > leftover flags are handled.
> >
> > What do I need to do to get these new flags to nova boot from novaclient
> > into nova-api and ultimately my compute driver?
> >
> > Thanks for any help!
> >
> > -Drew Fisher
> >
> > _______________________________________________
> > OpenStack-dev mailing list
> > OpenStack-dev at lists.openstack.org
> > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20131026/56009158/attachment.html>


More information about the OpenStack-dev mailing list