On 12.09.13 10:52, bigclouds wrote:
> hi,
> it fails in my test. i have no idea why?  how to take advantage of this 
> feature.
> meanwhile i think sysprep goes too far.
It's not sysprep its payload (which can be used by sysprep but not must).
Payload will let you add files to the VM in the simplest way via the command
line:

$ curl -X PUT -H "Accept: application/xml" -H "Content-Type: application/xml" 
-u USER@DOMAIN:PASSWORD -d "<vm><payloads> <payload type='cdrom'> <file 
name='MYFILE.txt'> <content>SOME CONTENT</content> </file> </payload> 
</payloads> </vm>" http://HOST:PORT/api/vms/VMID 
(You need to replace all upper case words in this command with the relevant
values)

We are sending the following xml:
<vm>
    <payloads>
        <payload type='cdrom'> 
            <file name='MYFILE.txt'>
            <content>
                SOME CONTENT
            </content> 
            </file> 
        </payload> 
    </payloads>
</vm>

The hooks that under vdsm/vdsm_hooks are not part of vdsm as you can read
here:
http://gerrit.ovirt.org/gitweb?p=vdsm.git;a=blob_plain;f=vdsm_hooks/README;hb=HEAD

Shahar Havivi.

> 
> 
> 
> 
> At 2013-09-11 15:06:31,"Shahar Havivi" <shah...@redhat.com> wrote:
> >On 11.09.13 01:50, Andrew Cathrow wrote:
> >> Could sysprep be used? 
> >Yes,
> >If you may consider using the VM Payload feature that is letting you "inject"
> >files from a CD-ROM or Floppy disk.
> >You can read about it here:
> >http://www.ovirt.org/Features/VMPayload
> >
> >> 
> >> ----- Original Message -----
> >> 
> >> > From: "bigclouds" <bigclo...@163.com>
> >> > To: "Shahar Havivi" <shah...@redhat.com>
> >> > Cc: vdsm-devel@lists.fedorahosted.org
> >> > Sent: Tuesday, September 10, 2013 10:45:04 PM
> >> > Subject: Re: [vdsm] question about injectfile hook
> >> 
> >> > hi,Shahar Havivi:
> >> > yes, i am working on modifying windows-hostname before_vm_start.
> >> > i will make out a workaround to handle qcow2 format.
> >> > im my case i need to add a new hook.
> >> 
> >> > At 2013-09-10 22:32:48,"Shahar Havivi" <shah...@redhat.com> wrote:
> >> > >On 10.09.13 22:02, bigclouds wrote:
> >> > >> hi, shaharh:
> >> > >> recently i work on injecting file into guestvm, i find a hook called
> >> > >>   injectfile in vdsm.
> >> > >> i have a confusion about   why injectfile hook takes qcow2 format as a
> >> > >>  special one which can not be handled?
> >> > >> could you tell me your reason?
> >> > >>  
> >> > >> as i know libguestfs certainly can be aware of qcow2 and all its 
> >> > >> feature
> >> > >>  like backing_file  etc.
> >> > >> it is a little hard to inject files into a image which has backing
> >> > >>  files(maybe backing chain)  especially for images of block type with
> >> > >>  thin-providing. like a vm in pool.
> >> > >> i am now writing code to inject files into a vm in pool.
> >> > >> please tell me your ideas. and my questoin.
> >> > >It should work with qcow2, when this hook was written we had some issues
> >> > > that
> >> > >we limit the format to raw.
> >> > >did you try to modify the hook script? (by removing the qcow only 
> >> > >condition)
> >> > >
> >> > >>  
> >> > >> thanks
> >> > >>  
> >> > >>
> >> 
> >> > _______________________________________________
> >> > vdsm-devel mailing list
> >> > vdsm-devel@lists.fedorahosted.org
> >> > https://lists.fedorahosted.org/mailman/listinfo/vdsm-devel
_______________________________________________
vdsm-devel mailing list
vdsm-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-devel

Reply via email to