ESXi

 View Only
  • 1.  Deploy a VM from template on linux and windows

    Posted Jun 03, 2013 07:40 AM

    Dear All,

    I need to deploy VM from template, but i could not find any tool provided with vSphere SDK in Perl. If you have a script which does this task please share with me, any pointer will also help ...

    Thanks,

    Nilesh



  • 2.  RE: Deploy a VM from template on linux and windows

    Posted Jun 03, 2013 07:45 AM

    Do you want a Perl based script or PowerCLI? Or just anything that works?



  • 3.  RE: Deploy a VM from template on linux and windows

    Posted Jun 03, 2013 08:21 AM

    Thank you for the response.

    I would prefer Perl based. Also i am bit familiar with Perl ...

    Message was edited by: nileshjais



  • 4.  RE: Deploy a VM from template on linux and windows

    Posted Jun 03, 2013 10:29 AM

    I tried to browse the discussion on this but i couldn't found any useful, please help me in this regards.



  • 5.  RE: Deploy a VM from template on linux and windows

    Posted Jun 03, 2013 11:37 AM

    I have some older code which should do the trick, it's available at https://github.com/nielsengelen/vmware-perl/blob/master/deploy-template.pl



  • 6.  RE: Deploy a VM from template on linux and windows

    Posted Jun 03, 2013 11:43 AM

    Thanks Nielse,

    You are life saver !! let me try this script and will update you accordingly. One more question, Will it configure ip address, subnet mask and network related configuration?

    Thanks again.

    Nilesh



  • 7.  RE: Deploy a VM from template on linux and windows

    Posted Jun 03, 2013 11:50 AM

    This script is a basic deploy, nothing more. If you want to do configure the IP and stuff you'll have to use a customization template or a bash script which does it for you after boot. You can then call this bash script using "startprograminguest".



  • 8.  RE: Deploy a VM from template on linux and windows

    Posted Jun 03, 2013 11:54 AM

    Wow !! I feel confident to proceed now, Will startprograminguest is an api of vSphere SDK, do we have any sample usage of this of reference script.



  • 9.  RE: Deploy a VM from template on linux and windows

    Posted Jun 05, 2013 04:21 AM

    This script works fine thank you again, But due to some restricted access to one of datacenter for my user, on which i am trying to deploy VM, i could not proceed and i am getting error message. just to let you know if we use this script with administrator user it works smoothly.

    Fault string: Permission to perform this operation was denied.

    Fault detail: NoPermissionFault


    What if i need to added identification of specific datacenter using --datacenter argument in this script will i need to perform some extra step before i proceed with $_->CloneVM, could you please tell me what changes is needed. That would really help me.