Showing posts with label VMware. Show all posts
Showing posts with label VMware. Show all posts

Tuesday, August 2, 2011

Deploying VM(s) with Powershell Script

I've been working on this for a while and currently use this to deploy VM(s) in batches for my environment.

It takes the parameters from a CSV file and deploys the standard OS VM(s) template to new VM(s). All you need to do is add any data/application drives. It isn't perfect, but I'm still working on it.








Things I want to add:
  • add any data/application drives
  • a method for deploying to appropriate datastore without checking GUI myself
  • check if dynamic virtual port group has enough free ports, adding one as needed
  • script more of the overall post VM deployment steps for my environment

Thursday, October 9, 2008

svmotion walkthrough

C:\>cd "\Program Files\VMware\VMware VI Remote CLI\bin"

C:\Program Files\VMware\VMware VI Remote CLI\bin>svmotion.pl --interactive

Entering interactive mode.  All other options and environment variables will be ignored.

Enter the VirtualCenter service url you wish to connect to (e.g. https://myvc.mycorp.com/sdk, or just myvc.mycorp.com): virtualcenter.somedomain.com
Enter your username: domainname\admin.credentials
Enter your password: XXXXXXXXXX

Connected to server.

Enter the name of the datacenter: DCname
Enter the datastore path of the virtual machine (e.g. [datastore1] myvm/myvm.vmx): [STORAGE-ARRAY1-LUN1] VMserver4/VMserver4.vmx
Enter the name of the destination datastore: STORAGE-ARRAY1-LUN2

You can also move disks independently of the virtual machine.  If you want the disks to stay with the virtual machine, then skip this step..
Would you like to individually place the disks (yes/no)? no

Performing Storage VMotion.
0% |----------------------------------------------------------------------------------------------------| 100%
    ##########################################################################################
Storage VMotion completed successfully.

Disconnecting.

C:\Program Files\VMware\VMware VI Remote CLI\bin>