If you install the VI Perl SDK, you'll get all sorts of fun sample  
scripts.

A manifest to use the sample scripts would be something like:

define esx_guest($datacenter=ha-datacenter,
                 $datastore,
                 $disk_size,
                 $guest_id=rhel5_64Guest,
                 $memory,
                 $nic1_net,
                $nic2_net,
                $num_cpu=2,
                $vmhost,
                $vmname,
                $server,
                 $ensure) {
     case $ensure {
         running: {
             exec{"vmprovision.pl --operation create --vmname $name   \
                 --datacenter $datacenter \
                 --datastore $datastore       \
                 --disksize $disk_size  \
                --guestid $guest_id \
                --memory $memory \
                --nic_network $nic1_net \
                --nic_network2 $nic2_net \
                --num_cpus $num_cpu \
                --vmhost $vmhost \
                --server $vmhost":
                        unless  => "datacenterlisting.pl --datacenter  
$datacenter --server $vmhost | grep $name",
                        alias => "esx_create_${name}"
             }
             exec{"powerops.pl --operation poweron --vmname $name -- 
server $vmhost":
                 require => Exec["esx_create_$name"]
             }
         }
         stopped: {
             exec{"powerops.pl --operation poweroff --vmname $name -- 
server $vmhost":}
         }
     }
}


This validates, but can't guarantee more ! We're using something  
slightly different in production, but not terribly so. If I get  
pestered enough I could put the proper manifest up, but this should  
get you going. Obviously you need to realize this define on a machine  
that has the SDK, and access to create the VMs in ESX(i). Perl scripts  
are all pretty bog standard SDK included samples.


On Apr 27, 2009, at 8:19 PM, Bjørn Dyre Dyresen wrote:

> Would you mind sharing a manifest showing how you are doing this?
>
> Regards
>
>
> 2009/4/25 dane foster <dane.fos...@gmail.com>
> You can create snapshots via either the perl vi api, or the rcli  
> tools. We're using puppet to call the perl api and provision guests  
> within ESXi, works a treat.
>
> /dane
>
>
> On Apr 25, 2009, at 2:59 AM, paul matthews wrote:
>
>> Actually Ohad, I think your script relates to VMware Server. My  
>> question related to the other free VMware product - ESXi which I  
>> think may be a non starter in puppet terms due to the difficulties  
>> with getting ruby on as Mike has suggested
>>
>> Cheers
>> Paul
>>
>> 2009/4/24 paul matthews <paulsmatth...@googlemail.com>
>> Ohad,
>> That's superb - I'll give that a try
>> Cheers
>> Paul
>>
>> 2009/4/24 Ohad Levy <ohadl...@gmail.com>
>>
>> if you are talking about normal vmware "free server edition" you  
>> can give this a try:
>> http://github.com/ohadlevy/puppet-vmware/tree/master
>>
>> Ohad
>>
>>
>> On Fri, Apr 24, 2009 at 9:19 PM, Mike Pountney <mike.pount...@gmail.com 
>> > wrote:
>>
>> Paul, are you talking about ESXi or the full blown ESX? I would  
>> expect
>> that it would be possible to puppetize the service console, but for
>> ESXi I would not expect it to be possible to get ruby on there.
>>
>>
>>
>> On 23 Apr 2009, at 16:51, paul matthews wrote:
>>
>> > When I say busybox it's actually VMware ESX server which seems to
>> > use busybox (which I guess is the case a number of other software
>> > appliances) . Reason for wanting to install puppet is to run the  
>> cli
>> > tools to create nightly vmware snapshots.
>> > I'm happy to give it a go (and add the docs to the wiki) but I'm  
>> not
>> > too sure at this stage how big a task this might be and what, if
>> > any, are the potential pitfalls
>> >
>> > Cheers
>> > Paul
>> >
>> > >
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> -- 
>> Paul Matthews
>> ----------------------------------------------------------------------
>>
>>
>>
>> -- 
>> Paul Matthews
>> ----------------------------------------------------------------------
>>
>>
>>
>
>
>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to