[Users] Linux sysprep
René Koch (ovido)
r.koch at ovido.at
Thu Aug 22 07:55:27 UTC 2013
On Wed, 2013-08-21 at 19:49 -0400, Greg Padgett wrote:
> On 08/21/2013 07:25 AM, René Koch (ovido) wrote:
> [snip]
> > I'm just playing around with the payload feature but I can't access the
> > cd/floppy in my vm.
> > I adapted Yuriy's script
> > (http://lists.ovirt.org/pipermail/users/2013-June/014907.html - which is
> > working fine btw) to create payload xml content and write it with
> > hooking.write_domxml(domxml).
> >
> > In vdsm.log I can see that my python script exits with status code 0 and
> > that the content seems to be added to the vm definition:
> >
> > Thread-130844::DEBUG::2013-08-21
> > 12:43:52,669::libvirtvm::1520::vm.Vm::(_run)
> > vmId=`79dc3123-4584-4dd9-b0f0-c28ede13d672`::<?xml version="1.0"
> > encoding="utf-8"?><domain type="kvm">
> > <name>centos6</name>
> > ....snip....
> > </cpu>
> > <payloads><payload type="cdrom"><file
> > name="unattended.txt"><content>hostname:
> > centos6</content></file></payload></payloads></domain>
> >
> >
> > But in my vm I can't mount the cd drive:
> > # mount /dev/sr0 /media
> > mount: you must specify the filesystem type
> >
> > Is there a special filesystem I have to specify?
> >
> > Furthermore shouldn't I be able to see the payloads content added to
> > this vm via REST-API? Because I can't.
> >
> > Maybe I'm doing some wrong?
> >
> >
> > Thanks,
> > René
>
> That's a neat script. I haven't used it--instead I just send xml to the
> rest api, something like this, which looks a lot like yours:
>
> <vm id="6aec2d40-e36f-4b02-ab75-933d93f4cb8b"
> href="/api/vms/6aec2d40-e36f-4b02-ab75-933d93f4cb8b">
> <payloads>
> <payload type="cdrom">
> <file name="meta-data.txt"><content>some content</content> </file>
> </payload>
> </payloads>
> </vm>
>
> To attach the payload via the rest api, note that you'd need to send a put
> request to /api/vms/<uuid> rather than pass the xml in the run/start
> action, because that's not yet supported. Doing this, inside my vm I see:
>
> [root at cloud-init-test ~]# blkid
> /dev/sr1: UUID="2013-08-21-19-39-40-00" LABEL="CDROM" TYPE="iso9660"
I see - so only via REST-API really means only with REST-API ;)
I'll add the payload via put request - thanks a lot!
>
> And I can mount it without any problems. You can also check the qemu
> process listing on the host--for instance, mine shows:
>
> /usr/bin/qemu-system-x86_64 [...] -drive
> file=/var/run/vdsm/payload/29e331f9-42df-46e1-aad1-88101b134606.fe53caf3339d55b2b37a893e19e9f10a.img
>
> While the vm is running, you can check that file with `file` (should
> report ISO 9660), mount it on the host, etc.
>
> HTH,
> Greg
>
More information about the Users
mailing list