Tag Archives: VMware

Use PowerCLI to get an inventory of VMs

Say your boss asks you to plan for expansion and you need to get an inventory of the VMs in your current environment with their resource consumption.  What’s the VMware answer for this?  Oh buy VCOPs… wait that’s right I don’t have 100k that I can drop right now.  Oh there’s a free way to export this to excel?  How would I do that?!  PowerCLI!

To get an inventory of VMs from your ESXi hosts using PowerCLI:

Get-VM | Export-Csv –path “c:\users\josh\desktop\myVMs.csv” –NoTypeInformation

This will export a CSV file with the following fields:

CDDrives
Client
CustomFields
DatastoreIdList
Description
DrsAutomationLevel
ExtensionData
FloppyDrives
Folder
FolderId
Guest
HAIsolationResponse
HardDisks
HARestartPriority
Host
HostId
Id
MemoryGB
MemoryMB
Name
NetworkAdapters
Notes
NumCpu
PersistentId
PowerState
ProvisionedSpaceGB
ResourcePool
ResourcePoolId
Uid
UsbDevices
UsedSpaceGB
VApp
Version
VMHost
VMHostId
VMResourceConfiguration
VMSwapfilePolicy

 

If you don’t need all of those fields you can select the ones you need with the following syntax:

Get-VM | select Name, Guest, MemoryGB, ProvisionedSpaceGB, UsedSpaceGB | Esxport-CSV –path c:\users\josh\desktop\myVMs.csv –NoTypeInformation

If you don’t type –NoTypeInformation then you will get the following at the beginning of your CSV: #TYPE Selected.Vmware.VimAutomation.ViCore.Impl.V1.Inventory.VirtualMachineImpl

VMware View Composer: The database specified is not supported by [ProductName].

Deploying another View Pod in our infrastructure I installed View Composer.  The other Pods used SQL Server 2012 so I created the databases and ODBC connections.  After specifying the ODBC connection I received the error The database specified is not supported by [ProductName].

image

It appears that this error is caused by the SQL ODBC driver.  I installed the SQL Management tools from SQL Server 2008 and changed the SQL driver to the SQL Server 2008 version (SQL Server Native Drivers v10) and recreated the ODBC connection.

image

image

Yay! The install continues!

image

VMWare Fusion: Switch from Full Screen to Mac Applications

When Command+Tab switching between my fullscreen Windows session and another Mac application I would be able to switch to VMware fusion, but I would not be able to switch back to the fullscreen session without clicking on the Window menu and selecting my VM.

I should also further clarify that this is a 27” iMac with two external monitors attached.  When running in single monitor mode I was able to switch fine, however when I go into full screen mode with multiple monitors I couldn’t Command+Tab switch back to my Windows VM.

I figured out this behavior is caused by Mission Control in OS 10.8.  To resolve the issue I checked “When switching to an application, switch to a space with open windows for the application”.  Voila!  I can now switch between my Mac OS apps and my fullscreen Windows session!

image