PowerCLI: Empty Resource Pool

Just a quick one today and I'm only putting it up here because it's a one-liner and they always make me smile 🙂 Of the multiple clusters on one vCenter server that I'm working on, one of them has some resource pools that we don't really need. Rather than dragging and dropping a few dozen VMs from one resource pool to the root resource pool of the cluster in the vSphere client I thought I'd use PowerCLI. [ps]Get-ResourcePool -name "MyResourcePool" | Get-VM | Move-VM -Destination (Get-Cluster -name "MyCluster" | Get-ResourcePool -name "Resources&…

Read More

Finding HA Primary Nodes

A question came up in yesterday's “Chad's Choice” webcast about choosing which hosts in a cluster would be configured as HA primary nodes. I'm not going to go into any great detail here about what HA primary nodes are because there is a more comprehensive article on HA freely available over on the Yellow Bricks blog of Duncan Epping. The short answer to whether or not you can choose HA primary nodes is a simple “no”. It's not possible. Things are rarely simple though. Technically it is possible (again see Duncan's HA deepdive page for details)…

Read More

List of VMX Files

Don't ask me why but I wanted a list of .VMX files for all of the virtual machines registered in vCenter. With a little experimentation it was easy to come up with a oneliner. [ps]Get-VM | Get-View | % { $_.Config.Files.VmPathName }[/ps] However, that's not the quickest way. The output takes ages to display because each VM is passed along the pipeline one at a time resulting in multiple Get-View queries. The following is faster: [ps]Get-View -ViewType VirtualMachine | % { $_.Config.Files.VmPathName }[/ps] Although it is a bigger query, the single Get-View call makes the whole thing so much faster. I…

Read More

Display vSCSIStats Data With Microsoft Chart Controls

I had to run vSCSIStats for the first time in a while the other day. Normally, trying to display the data that it outputs in a graphical form involves some cutting and pasting and a wrestling match with Excel. I recalled this time that someone had tried to automate the process in the past and a quick google search sent me to Gabe's site and an article that he wrote back in February. The Excel macro (written by Paul Dunn) that was the subject of the article looked like just the job but I couldn't get it to work for…

Read More

PowerCLI: New cmdlets for Update Manager

VMware have this morning / last night released some PowerCLI cmdlets for VMware Update Manager (VUM). A short description can be found of them below: Cmdlet Name Cmdlet Description Attach-Baseline Attaches baselines to the specified Template, VirtualMachine, VMHost, Cluster, Datacenter, Folder, and VApp objects. Attaching a baseline to a container object such as a folder or datacenter transitively attaches the baseline to all objects in the container. Detach-Baseline Detaches baselines from the specified inventory objects. Download-Patch Downloads new patches into the Update Manager patch repository from the enabled patch download sources. Get-Baseline Retrieves the baselines specified by the provided cmdlet parameters.…

Read More

Basics: Open PowerCLI using different credentials

Everytime I use a different PC or laptop I always forget to do this after installing PowerCLI. I happily open PowerCLI up and try to connect to a vCenter server and get prompted for my login information. This is how I feel: Every time in that session that “Connect-VIServer” is used I'll get it because my normal domain account doesn't have any privileges in vCenter. The point of this post isn't to teach anyone to suck eggs but maybe it'll help me remember in future to make one tiny change after installing PowerCLI. Right click on the PowerCLI…

Read More