Solved

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

Posted on 2011-03-10
6
994 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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.
Employees depend heavily on their PCs, and new threats like ransomware make it even more critical to protect their important data.
Advanced tutorial on how to run the esxtop command to capture a batch file in csv format in order to export the file and use it for performance analysis. He demonstrates how to download the file using a vSphere web client (or vSphere client) and exp…
In this Micro Tutorial viewers will learn how to use Windows Server Backup to create full image of their system. Tutorial shows how to install Windows Server Backup Feature on Windows 2012R2 and how to configure scheduled Bare Metal Recovery backup.…

815 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

9 Experts available now in Live!

Get 1:1 Help Now