Solved

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

Posted on 2011-03-10
6
992 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
Comment Utility
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
Comment Utility
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
Comment Utility
depends on what you're trying to accomplish
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 16

Accepted Solution

by:
danm66 earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

VM backup deduplication is a method of reducing the amount of storage space needed to save VM backups. In most organizations, VMs contain many duplicate copies of data, such as VMs deployed from the same template, VMs with the same OS, or VMs that h…
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
In this Micro Tutorial viewers will learn how to restore single file or folder from Bare Metal backup image of their system. Tutorial shows how to restore files and folders from system backup. Often it is not needed to restore entire system when onl…

763 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

10 Experts available now in Live!

Get 1:1 Help Now