Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-03-10
6
Medium Priority
?
1,010 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:Paul Solovyovsky
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:Paul Solovyovsky
ID: 35101087
depends on what you're trying to accomplish
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Accepted Solution

by:
Danny McDaniel earned 1500 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:Paul Solovyovsky
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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
Eseutil Hard Recovery is part of exchange tool and ensures Exchange mailbox data recovery when mailbox gets corrupt due to some problem on Exchange server.
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This video shows you how to use a vSphere client to connect to your ESX host as the root user. Demonstrates the basic connection of bypassing certification set up. Demonstrates how to access the traditional view to begin managing your virtual mac…

916 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