Solved

How to remove/add VMs in mass via PowerCLI or Putty?

Posted on 2011-03-10
6
993 Views
Last Modified: 2012-08-13
Just curious to see if anyone has actually been able to do this. VMware says they don't currently have a simple way to perform the task. When performing our DR refresh every quarter, we run into things like this issue that would vastly improve our lives, as well as many others I'm sure.

Thanks,
-Joshua
0
Comment
Question by:jwaszczak
  • 3
  • 2
6 Comments
 
LVL 42

Expert Comment

by:paulsolov
ID: 35099802
If doing many VMs use PowerCLI, for better yet download PowerGUI from powergui.org and install the vsphere powerpack.  Check it out, it will make your life much simpler
0
 

Author Comment

by:jwaszczak
ID: 35099834
Paul: I use PowerCLI (novice) and PowerGUI also (novice)....what I am looking for is the actual command/script to perform the aforementioned task. Thanks.
0
 
LVL 42

Expert Comment

by:paulsolov
ID: 35101087
depends on what you're trying to accomplish
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 16

Accepted Solution

by:
danm66 earned 500 total points
ID: 35103016
there's been a couple of times I've wanted something that would do this, too.  I figured it would have to be a shell script though, because you would have to scan the datastore(s) to find all of the .vmx files.  I don't know if there's any way in the CLI or GUI to do this...since they interface with the host or VC and the VM's aren't in the inventory (otherwise, you wouldn't need to add them to inventory, right?).

I figured it would start with a 'find /vmfs/volumes -name *.vmx' and then pipe it into vmware-cmd to do the registering.  Whatever host the script was ran from would be the recipient of all of the VM's but at power-on, DRS would spread them out on different hosts.

0
 
LVL 42

Expert Comment

by:paulsolov
ID: 35103274
take a look at this link and see what you can do with powercli. Anything that you can do manually you can script.  What exactly is the goal?

http://www.simple-talk.com/sysadmin/virtualization/10-steps-to-kick-start-your-vmware-automation-with-powercli/
0
 

Author Closing Comment

by:jwaszczak
ID: 35142472
Dan: I've got the script for power off, remove from inventory, rescan all HBAs, register vm, move vms to/from hosts and power on working....Just need to adjust them some. Thank you for your help.
-Joshua
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When converting a physical machine to a virtual machine using VMware vCenter Converter Standalone or vCenter Converter Enterprise, if an adapter type is not selected during the initial customization the resulting virtual machine may contain an IDE d…
HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This Micro Tutorial steps you through the configuration steps to configure your ESXi host Management Network settings and test the management network, ensure the host is recognized by the DNS Server, configure a new password, and the troubleshooting…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now