Article: AN0001780Updated: 03.12.2018
This function returns a list of virtual machines with their properties from vCenter servers according to the configuration.
Main prerequisites for use
Prerequisite |
Description |
Powershell remoting |
When communicating with external systems using execution of Powershell commands by an external system it is necessary to enable remoting on the external system. |
vCenter Reader |
Role for reading data from VMware vCenter. |
Práva na službu WinRM |
When communicating with external systems using execution of Powershell commands by an external system it is necessary to assign access rights for remoting to the account sending the command. |
Powershell v3 |
Microsoft Powershell version 3 or higher. |
Description
Function creates a text file containing information about virtual machines according to the configuration. The file contains following information.
Column heading |
Description |
VMName |
Name of the virtual server in Vcenter. |
GuestShortName |
Name of the virtual server. |
GuestDomain |
Name of the domain of the virtual server. |
GuestFQDN |
FQDN of the virtual server. |
GuestOS |
Operating system of the server. |
GuestIP |
IP address/addresses of the server. |
DC |
Name of the Datacenter in vCenter. |
Cluster |
Name of the Cluster in vCenter. |
HostName |
Name of the ESX server, on which the machine is hosted at the moment. |
VMNotes |
Comments to the server in vCenter. |
VMNumCPU |
Number of CPU allocated to the server. |
VMMemoryGB |
Number of GB RAM allocated to the server |
VMUsedSpaceGB |
Space on disks used by the server in GB. |
VMProvisionedSpaceGB |
Space on disks allocated to the server in GB. |
VMMacAddress |
MAC address of the server. |
VMPowerState |
Status of the virtual server (PoweredOn/PoweredOff). |
ToolsVersion |
Version of VMware tools. |
ToolsStatus |
Status of VMware tools. |
ToolsVersionStatus |
Status of VMware tools version. |
ToolsRunningStatus |
Status of VMware tools running. |
VMXLocation |
Placement of VMX file. |
VMDKLocation |
Placement of VMDK file. |
Optional columns |
There can be other columns in the output file with values according to the parameter $VMCustParams. |
Parameters
Include hereinafter stated parameters in the file og_configuration.ps1 (generic parameters shared with other functions) or in the file OG_PC-Start.config (specific parameters of this function). Parameter configuration is described in the documentation of the programme Piklo.
Parameter |
Description |
Example |
[string]$OutFile |
Path to the file, in which output of the function shall be stored. |
[string]$ExportFile = "\\yourserver\data\OG-output\VM-Report.txt"
|
[string]$LogFile |
Path to the file, in which log of the function shall be stored. |
[string]$LogFile = "\\yourserver\data\OG-output\VM-Report_Log.txt"
|
[string]$OutEnc |
Coding of the output file. Possible options are "UTF8", "Unicode" and "DEFAULT". The value "DEFAULT" makes the file being created in the ANSI encoding. |
[string]$OutFileEncoding = "UTF8"
|
[string]$Delimiter |
Value separator in the records. Possible values are: "t" - tab, ";" - semicolon a "," - comma |
[string]$Delimiter = "t"
|
[string]$HeaderOutFile |
Defines, wheather the output file shall include header with column names ("1") or not ("0").
|
[string]$HeaderOutFile = "1"
|
[string]$HeaderOutFile = "1"
|
Path to a working directory. |
[string]$WorkFilePath = "\\servername\OGtemp"
|
[array]$vCenterServers |
Array with names of vCenter servers, that will be queried. |
("vcenter1.yourdomain.com","vcenter2.yourdomain.com") |
[string]$VMNotes |
Defines, wheather the output file shall include values from VMNotes ("1") or not ("0"). |
[string]$VMNotes = "1" |
[array]$VMCustParams |
Array with custom parameters defined in vCenter by the customer. |
("DRPriorioty","CreatedBy") |
[string]$VMOnlyRunningTools |
Defines, wheather the output file shall include only servers with running tools ("1") or not ("0"). Servers with running tools can provide information from the virtual machine. |
[string]$VMOnlyRunningTools = "1" |
Call
The function is called by means of the programme Piklo, that is part of ObjectGears package, from ObjectGears script. Result of the call has to be assigned to a variable, with which the script can further work.
a = OG.Process.RunPiklo('OG_VMReport-1.0','-type C')