All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Florath <xen@flonatel.org>
To: xen-devel@lists.xensource.com
Subject: xenapi.VM.create() with (data) uri for PV_kernel and PV_ramdisk
Date: Tue, 14 Jul 2009 21:02:37 +0200	[thread overview]
Message-ID: <4A5CD64D.6000801@flonatel.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1800 bytes --]

Hello!

In my environment there is a central management system which starts
domUs on different dom0s.  This should be done with the help
of the XenAPI.  The problem is that when creating a VM, the remote
local filename must be specified (PV_kernel and PV_ramdisk).
This is a kind of strange; especially when a shared storage between all
dom0s is not possible.
To fix this, I added support for the data uri (as described in RFC 2397)
for the PV_kernel and PV_ramdisk parameters. So it is now possible to
specify the vm in the management system like:
    vmdesc = {
        'memory_dynamic_max': 96 * 1024 * 1024,
        'memory_static_max': 96 * 1024 * 1024,
        'PV_kernel': schema_data.create_from_file(
            "/debian/images/vmlinuz-2.6.26-2-xen-686"),
        'PV_ramdisk': schema_data.create_from_file(
            "/debian/images/initrd.img-2.6.26-2-xen-686"),
    ... }
    xenapi.VM.create(vmdesc)
The images are send base64 encoded to the remote host; there the files
are extracted and the vm is started with these files (mostly the same
idea as in pygrub).

The attached code should be seen as PoC.  The following things must be done:
o Add more test cases (file writer is not tested very well)
o The temp files must be deleted at some point of time (check how this
is done in pygrub).
o Add more encodings (RFC 2397 allows also URL encoding) [Really needed?]
o What about other language bindings? (Java, C, ...)
o Adapt documentation

My questions:
1) What do you think about this approach?
2) Is there a chance that this idea will make it to the xen-unstable some
   day?

If there is some kind of 'yes' for the second question, I'll invest some
time and clean up the code and handle the other ToDos.

Any additional hints / remarks are welcome.

Kind regards

Andreas Florath


[-- Attachment #2: fileuri-0.1.tar.gz --]
[-- Type: application/x-gzip, Size: 3496 bytes --]

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2009-07-14 19:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A5CD64D.6000801@flonatel.org \
    --to=xen@flonatel.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.