You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by Michal Fojtik <mf...@redhat.com> on 2011/07/20 15:50:54 UTC

User data injection in VSphere

Hi,

to avoid many future questions how does this work I decide to write a simple howto:

1. Prepare an CD-ROM ISO image (Joilet with Rock Ridge extension) with files you want to
   access within instance

   mkdir myfolder
   cp file1 myfolder
   mkisofs -JR myfolder > myfiles.iso 


2. Gzip his ISO using standard 'gzip' utility

   gzip myfiles.iso

3. Encode this gzipped file in Base64:

   openssl base64 -in myfiles.iso.gz -out myfiles.iso.b64

4. Start up deltacloud-core with VMWare driver and go to new instance form
5. Copy and paste content of myfiles.iso.b64 in text box there
6. Launch instance

Now, when the instance will be ready and you will connect to it, content of
ISO image should be accessible after you mount an CD-ROM drive.

Hope it helps someone :)

  -- Michal

------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org


Re: [DELTACLOUD-INTERNAL] User data injection in VSphere

Posted by Francesco Vollero <fv...@redhat.com>.
On Wed, Jul 20, 2011 at 10:02:22AM -0400, Hugh Brock wrote:
> On Wed, Jul 20, 2011 at 03:55:59PM +0200, Michal Fojtik wrote:
> > 
> > On Jul 20, 2011, at 3:52 PM, Hugh Brock wrote:
> > 
> > > On Wed, Jul 20, 2011 at 03:50:54PM +0200, Michal Fojtik wrote:
> > >> Hi,
> > >> 
> > >> to avoid many future questions how does this work I decide to write a simple howto:
> > >> 

[snip]

> > > running in order for this to work?
> > 
> > Negative, VMWare tools are just needed to get IP address out of instance.
> > 
> >   -- Michal
> 
> Oh, that's really cool. How does the instance know to mount it?
>

Trough soap interface we tell to vmware what he had to mount, what kind of support (Floppy, ISO, USB)
 
> So that says to me that you could use this mechanism to do all manner
> of data and config injection without requiring a config server at
> all. For example, if your guest was configured to look in a particular
> spot in the user data for a script, and that script installed VMWare
> tools, you wouldn't have to pre-install them in the image.
>
 
Exactly, you've just to add everything you need on the iso image and have a script to do the dirty job.

Cheers,
Francesco

> --Hugh
> 
> -- 
> == Hugh Brock, hbrock@redhat.com                                   ==
> == Engineering Manager, Cloud BU                                   ==
> == Aeolus Project: Manage virtual infrastructure across clouds.    ==
> == http://aeolusproject.org                                        ==
> 
> "I know that you believe you understand what you think I said, but I’m
> not sure you realize that what you heard is not what I meant."
> --Robert McCloskey

Re: [DELTACLOUD-INTERNAL] User data injection in VSphere

Posted by Hugh Brock <hb...@redhat.com>.
On Wed, Jul 20, 2011 at 03:55:59PM +0200, Michal Fojtik wrote:
> 
> On Jul 20, 2011, at 3:52 PM, Hugh Brock wrote:
> 
> > On Wed, Jul 20, 2011 at 03:50:54PM +0200, Michal Fojtik wrote:
> >> Hi,
> >> 
> >> to avoid many future questions how does this work I decide to write a simple howto:
> >> 
> >> 1. Prepare an CD-ROM ISO image (Joilet with Rock Ridge extension) with files you want to
> >>   access within instance
> >> 
> >>   mkdir myfolder
> >>   cp file1 myfolder
> >>   mkisofs -JR myfolder > myfiles.iso 
> >> 
> >> 
> >> 2. Gzip his ISO using standard 'gzip' utility
> >> 
> >>   gzip myfiles.iso
> >> 
> >> 3. Encode this gzipped file in Base64:
> >> 
> >>   openssl base64 -in myfiles.iso.gz -out myfiles.iso.b64
> >> 
> >> 4. Start up deltacloud-core with VMWare driver and go to new instance form
> >> 5. Copy and paste content of myfiles.iso.b64 in text box there
> >> 6. Launch instance
> >> 
> >> Now, when the instance will be ready and you will connect to it, content of
> >> ISO image should be accessible after you mount an CD-ROM drive.
> >> 
> >> Hope it helps someone :)
> >> 
> >>  -- Michal
> > 
> > This is awesome Michal. Does the instance have to have VMWare tools
> > running in order for this to work?
> 
> Negative, VMWare tools are just needed to get IP address out of instance.
> 
>   -- Michal

Oh, that's really cool. How does the instance know to mount it?

So that says to me that you could use this mechanism to do all manner
of data and config injection without requiring a config server at
all. For example, if your guest was configured to look in a particular
spot in the user data for a script, and that script installed VMWare
tools, you wouldn't have to pre-install them in the image.

--Hugh

-- 
== Hugh Brock, hbrock@redhat.com                                   ==
== Engineering Manager, Cloud BU                                   ==
== Aeolus Project: Manage virtual infrastructure across clouds.    ==
== http://aeolusproject.org                                        ==

"I know that you believe you understand what you think I said, but I’m
not sure you realize that what you heard is not what I meant."
--Robert McCloskey

Re: [DELTACLOUD-INTERNAL] User data injection in VSphere

Posted by Michal Fojtik <mf...@redhat.com>.
On Jul 20, 2011, at 3:52 PM, Hugh Brock wrote:

> On Wed, Jul 20, 2011 at 03:50:54PM +0200, Michal Fojtik wrote:
>> Hi,
>> 
>> to avoid many future questions how does this work I decide to write a simple howto:
>> 
>> 1. Prepare an CD-ROM ISO image (Joilet with Rock Ridge extension) with files you want to
>>   access within instance
>> 
>>   mkdir myfolder
>>   cp file1 myfolder
>>   mkisofs -JR myfolder > myfiles.iso 
>> 
>> 
>> 2. Gzip his ISO using standard 'gzip' utility
>> 
>>   gzip myfiles.iso
>> 
>> 3. Encode this gzipped file in Base64:
>> 
>>   openssl base64 -in myfiles.iso.gz -out myfiles.iso.b64
>> 
>> 4. Start up deltacloud-core with VMWare driver and go to new instance form
>> 5. Copy and paste content of myfiles.iso.b64 in text box there
>> 6. Launch instance
>> 
>> Now, when the instance will be ready and you will connect to it, content of
>> ISO image should be accessible after you mount an CD-ROM drive.
>> 
>> Hope it helps someone :)
>> 
>>  -- Michal
> 
> This is awesome Michal. Does the instance have to have VMWare tools
> running in order for this to work?

Negative, VMWare tools are just needed to get IP address out of instance.

  -- Michal

> 
> --Hugh
> 
> 
> -- 
> == Hugh Brock, hbrock@redhat.com                                   ==
> == Engineering Manager, Cloud BU                                   ==
> == Aeolus Project: Manage virtual infrastructure across clouds.    ==
> == http://aeolusproject.org                                        ==
> 
> "I know that you believe you understand what you think I said, but I’m
> not sure you realize that what you heard is not what I meant."
> --Robert McCloskey

------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org


Re: [DELTACLOUD-INTERNAL] User data injection in VSphere

Posted by Hugh Brock <hb...@redhat.com>.
On Wed, Jul 20, 2011 at 03:50:54PM +0200, Michal Fojtik wrote:
> Hi,
> 
> to avoid many future questions how does this work I decide to write a simple howto:
> 
> 1. Prepare an CD-ROM ISO image (Joilet with Rock Ridge extension) with files you want to
>    access within instance
> 
>    mkdir myfolder
>    cp file1 myfolder
>    mkisofs -JR myfolder > myfiles.iso 
> 
> 
> 2. Gzip his ISO using standard 'gzip' utility
> 
>    gzip myfiles.iso
> 
> 3. Encode this gzipped file in Base64:
> 
>    openssl base64 -in myfiles.iso.gz -out myfiles.iso.b64
> 
> 4. Start up deltacloud-core with VMWare driver and go to new instance form
> 5. Copy and paste content of myfiles.iso.b64 in text box there
> 6. Launch instance
> 
> Now, when the instance will be ready and you will connect to it, content of
> ISO image should be accessible after you mount an CD-ROM drive.
> 
> Hope it helps someone :)
> 
>   -- Michal

This is awesome Michal. Does the instance have to have VMWare tools
running in order for this to work?

--Hugh


-- 
== Hugh Brock, hbrock@redhat.com                                   ==
== Engineering Manager, Cloud BU                                   ==
== Aeolus Project: Manage virtual infrastructure across clouds.    ==
== http://aeolusproject.org                                        ==

"I know that you believe you understand what you think I said, but I’m
not sure you realize that what you heard is not what I meant."
--Robert McCloskey

Re: User data injection in VSphere

Posted by Francesco Vollero <ra...@gmail.com>.
On Thu, Jul 21, 2011 at 12:20 AM, David Lutterkort <lu...@redhat.com> wrote:
> On Wed, 2011-07-20 at 15:50 +0200, Michal Fojtik wrote:
>> to avoid many future questions how does this work I decide to write a simple howto:
>
> This is really powerful and nice, but it is very different from what
> we've called feature 'user_data' so far; we should call it something
> else, say 'user_iso' or whatever.
>

Thanks David, with Michal we decided this helpers was able to create a
whole FileManager interface to simplify as much as possible the
interaction with vsphere, since it is a pain to deal with soap
methods.

> We should also support straightup 'user_data', i.e. the ability to post
> a base64 encoded string on instance creation, which we will then put
> into a fixed file (say '/deltacloud-user-data.txt') in a new ISO image.
>

I gonna start working on it tomorrow :)

>> 3. Encode this gzipped file in Base64:
>>
>>    openssl base64 -in myfiles.iso.gz -out myfiles.iso.b64
>
> Wouldn't plain old 'base64' work here as well ?
>

David, forgive Michal, he's developing on OSX :)

> David
>
Cheers,
Francesco

Re: User data injection in VSphere

Posted by David Lutterkort <lu...@redhat.com>.
On Wed, 2011-07-20 at 15:50 +0200, Michal Fojtik wrote:
> to avoid many future questions how does this work I decide to write a simple howto:

This is really powerful and nice, but it is very different from what
we've called feature 'user_data' so far; we should call it something
else, say 'user_iso' or whatever.

We should also support straightup 'user_data', i.e. the ability to post
a base64 encoded string on instance creation, which we will then put
into a fixed file (say '/deltacloud-user-data.txt') in a new ISO image.

> 3. Encode this gzipped file in Base64:
> 
>    openssl base64 -in myfiles.iso.gz -out myfiles.iso.b64

Wouldn't plain old 'base64' work here as well ?

David