June 4, 2017

Warnning on Esxi Server "System logs are stored on non-persistent storage"

To verify the location:
  1. In vSphere Client, select the host in the inventory panel.
  2. Click the Configuration tab, then click Advanced Settings under Software.
  3. Ensure that Syslog.global.logDir points to a persistent location.
  4. The directory should be specified as [datastorename] path_to_file where the path is relative to the datastore. For example, [datastore1] /systemlogs.

  5. If the Syslog.global.logDir field is empty or explicitly points to a scratch partition, make sure that the field ScratchConfig.CurrentScratchLocation shows a location on persistent storage.



Initialize-PowerCLIEnvironment.ps1 cannot be loaded because the execution of scripts is disabled on this system

Initialize-PowerCLIEnvironment.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:2
PS C:\> Get-ExecutionPolicy
Restricted
PS C:\> Set-ExecutionPolicy RemoteSigned
 
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic. Do you want to change the execution policy?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): y
PS C:\> Get-ExecutionPolicy
RemoteSigned

Get VM's affected by HA Events - since Yesterday

Login to vCenter using PowerCLI
Run Below command ,  it will give you HA rebooted VMs within Past Day..

$Date=Get-Date
$HAVMrestartold=1
Get-VIEvent -maxsamples 100 -Start ($Date).AddDays(-$HAVMrestartold) -type warning | Where {$_.FullFormattedMessage -match "restarted"} |select CreatedTime,FullFormattedMessage |sort CreatedTime -Descendin

Usefull Esxcli network ip commands

esxcli network ip interface list
esxcli network ip interface ipv4 get -n vmk<X>
esxcli network ip interface ipv6 get -n vmk<X>
esxcli network ip interface ipv6 address list
You can retrieve information about DNS with the esxcli network ip dns command in the following two namespaces:
esxcli network ip dns search
esxcli network ip dns server
For information corresponding to the Linux netstat command, use the following ESXCLI command.
esxcli network ip connection list