Get List of VM's on server: Get-VM
VM detailed information: Get-VM | Format-List -property *
Customized VM's report: Get-VM | select-object -property Name,Notes, VMHost,Guest
Suppress warnings:
Set-Powercliconfiguration -Displaydepricationwarnings $false -scope -user
Using WildCards:
Select Specific virtual Machine: Get-VM -Name A*
Using Comparision Operations
-eq
-ne
-gt
-ge
-lt
-le
Using Aliases
Retriving list of all of hosts
get-Hosts
Wednesday, May 14, 2014
PowerCLI - Initial connection script commands
Connecting to a server:
connect-VIserver -server 192.168.10.10 -credential $credential
connect-VIserver -server 192.168.10.10 -protocol http
Connecting to multiple servers: connect-VIserver -server 192.168.10.10 -credential $credential -ALLlinked
List all connected vCenters: connect-VIserver -Menu
Connect to multiple vCenters: connect-VIserver -server vCenter1,vCenter2,vCenter3
Current configuration mode: get-PowerCLIConfiguration
Set configuration mode: single or multple vCenters
set-PowerCliconfiguration
set-PowerCliconfiguration -DefaultVIServermode signle -scope user
The servers are stored in $global:DefaultServer
Suppress Certificate warnings
set-PowerCliConfiguration -InvalidCertificateAction Ignore
NFS Datastore
Mount
New-Datastore -VMHost abc.xyz.com -Nfs -Name Test -NfsHost nfsinterface.isilon.com -Path /ifs/datastore/templates
Remove Mount
Get-VMHost | Remove-Datastore -Datastore templates
Configure DNS Address
Get-VMHostNetwork | Get-VMHost | Set-VMHostNetwork -DomainName test.abc.com -DNSAddress 10.10.10.10, 10.20.20.20
Get-VMHostNetwork -VMHost host.test.abc.com | Set-VMHostNetwork -DomainName test.abc.com -DNSAddress 10.10.10.10, 10.20.20.20
Configure Syslog Datastore
Get-VMHost | Set-AdvancedSetting -NameValue @{'Config.HostAgent.log.level'='info';'Vpx.Vpxa.config.log.level'='info';'Syslog.global.logHost'='udp://sysng-te.test.statefarm.com:514'}
Create NFS adapters:
New-VMHostNetworkAdapter -VMHost host.abc.com -PortGroup INFR_ISILON_VLAN11 -VirtualSwitch switchname -IP 10.10.10.10 -SubnetMask 255.255.255.0 -MTU 9000
Disconnect from Servers:
disconnect-VIserver -server * -Force
Get Credentials:
get-VIcredentialStoreItem
some useful links: hostilecoding.blogspot.com/2014/03/vmware-powercli-to-report-triggered.html
https://www.simple-talk.com/sysadmin/virtualization/10-steps-to-kick-start-your-vmware-automation-with-powercli/
Restarting Powerpath Watch dog service
Script for running commands across all hosts in vcenter
connect-VIserver -server 192.168.10.10 -credential $credential
connect-VIserver -server 192.168.10.10 -protocol http
Connecting to multiple servers: connect-VIserver -server 192.168.10.10 -credential $credential -ALLlinked
List all connected vCenters: connect-VIserver -Menu
Connect to multiple vCenters: connect-VIserver -server vCenter1,vCenter2,vCenter3
Current configuration mode: get-PowerCLIConfiguration
Set configuration mode: single or multple vCenters
set-PowerCliconfiguration
set-PowerCliconfiguration -DefaultVIServermode signle -scope user
The servers are stored in $global:DefaultServer
Suppress Certificate warnings
set-PowerCliConfiguration -InvalidCertificateAction Ignore
NFS Datastore
Mount
New-Datastore -VMHost abc.xyz.com -Nfs -Name Test -NfsHost nfsinterface.isilon.com -Path /ifs/datastore/templates
Remove Mount
Get-VMHost | Remove-Datastore -Datastore templates
Configure DNS Address
Get-VMHostNetwork | Get-VMHost | Set-VMHostNetwork -DomainName test.abc.com -DNSAddress 10.10.10.10, 10.20.20.20
Get-VMHostNetwork -VMHost host.test.abc.com | Set-VMHostNetwork -DomainName test.abc.com -DNSAddress 10.10.10.10, 10.20.20.20
Configure Syslog Datastore
Get-VMHost | Set-AdvancedSetting -NameValue @{'Config.HostAgent.log.level'='info';'Vpx.Vpxa.config.log.level'='info';'Syslog.global.logHost'='udp://sysng-te.test.statefarm.com:514'}
Create NFS adapters:
New-VMHostNetworkAdapter -VMHost host.abc.com -PortGroup INFR_ISILON_VLAN11 -VirtualSwitch switchname -IP 10.10.10.10 -SubnetMask 255.255.255.0 -MTU 9000
Disconnect from Servers:
disconnect-VIserver -server * -Force
Get Credentials:
get-VIcredentialStoreItem
some useful links: hostilecoding.blogspot.com/2014/03/vmware-powercli-to-report-triggered.html
https://www.simple-talk.com/sysadmin/virtualization/10-steps-to-kick-start-your-vmware-automation-with-powercli/
Restarting Powerpath Watch dog service
Get-VMHost -name corpesx2g.test.statefarm.com | Get-VMHostService | where {$_.Key -match "sfcbd-watchdog"} | Restart-VMHostService -Confirm:$false
Enable and disable lock down mode on ESXi Host
(get-vmhost $ESXhost | get-view).ExitLockdownMode() # To DISABLE Lockdown Mode
(get-vmhost $ESXhost | get-view).EnterLockdownMode() # To ENABLE Lockdown Mode
Script for running commands across all hosts in vcenter
$vCenter = 'vCenterServer_Name_or_IP_address'
Connect-VIServer $vCenter
$Scope = Get-VMHost #This will change the Lockdown Mode on all hosts managed by vCenter
foreach ($ESXhost in $Scope) {
(get-vmhost $ESXhost | get-view).ExitLockdownMode() # To DISABLE Lockdown Mode
Get-VMHost -name corpesx2g.test.statefarm.com | Get-VMHostService | where {$_.Key -match "sfcbd-watchdog"} | Restart-VMHostService -Confirm:$false
#(get-vmhost $ESXhost | get-view).EnterLockdownMode() # To ENABLE Lockdown Mode
}
Disconnect-VIServer -Server $vCenter -Confirm:$false
Monday, May 5, 2014
VMAX - Powerpath, Unisphere, Solution Enabler Installation ( SE Install)
Powerpath Host Registartion
rpowermt register host=abc.xyz.com username=root password=xxxx
Powerpath Installation Procedure
1) Uninstall ELMS
2) Uninstall Rtools
3) verify service running service
From task manager
check wheather lmrgd is running from service
if running stop
4) check for license path
EMC - powerpath -rpowermt
move license to d:powerpath_server
5) Check for services
Check for lmrg path
6) disable emc powerpath (EMC_PP_LIC)
from services - powerpath properties
7) INSTALL POWERPATH ELMS
c:programfiles\emc\
choose powerpath license path
install
8) Install Rtools
windows folder
install
organization : statefarm
location default
install
9)
rpowermt version
check for license path
if it is C: change it to d using environmental settings
10) Change Environmental variables
control panel
system properties
PPMT_lic_path
D:\powerpath_version\filename
11)
verify rpowermt version
12) Verify LMTOOLS
Verify service name should be only LMTOOLS
programfiles(86)\emc\elms\
13) register esx hosts
Solution Enabler Installation (SE Install)
1. Stop ECOM service.
2. Make a backup of these folders:
On Windows:
C:\Program Files\EMC\ECIM\ECOM\conf\cst
C:\Program Files\EMC\ECIM\ECOM\conf\ssl
3. Uninstall existing version of SE and SMI provider. Sometimes we need to delete the symapi folders manually and then reboot the host
4. Install SE with SMI-S provider
Reboot the host and start the required daemons
5.Copy the backup(you made) folders mentioned in step 2 with the .
6. Start ECOM service.
7. Put back the deamon_options and deamon_users files back without replacing them
8. Restart the all the daemons order being storapid first
And verify storsrvd is running
Unisphere Install
Unisphere for VMAX: on D drive
Run the install.exe file --> Takes around 30 mins and install Flash if needed
Register the array for collecting stats
Login-->Performance tab-->settings-->select array and register
Requirement:
RAM-8Gb available
Disk space-25Gb available
Alert suppression:
AS a part of matrix upgrade, unisphere is getting upgraded to new code 1.6. As a part of installation process, there might be some alerts generated that needs
to be suppressed.
Implementation steps:
1. Log into the arms server "arms.test.com"
2. Uninstall SMAS 1.3.3 application through control panel
3. Run the Installation file "UNIVMAX_V1.6.0.8_WINDOWS_X86_64". Select D drive
4. After installation, Register the array into Unisphere for collecting stats as shown below
i) Login to Unisphere using "https://192.168.10.10:8443/"
ii) Select Performance tab
iii) Select settings
iv) Select the VMAX array and click register
rpowermt register host=abc.xyz.com username=root password=xxxx
Powerpath Installation Procedure
1) Uninstall ELMS
2) Uninstall Rtools
3) verify service running service
From task manager
check wheather lmrgd is running from service
if running stop
4) check for license path
EMC - powerpath -rpowermt
move license to d:powerpath_server
5) Check for services
Check for lmrg path
6) disable emc powerpath (EMC_PP_LIC)
from services - powerpath properties
7) INSTALL POWERPATH ELMS
c:programfiles\emc\
choose powerpath license path
install
8) Install Rtools
windows folder
install
organization : statefarm
location default
install
9)
rpowermt version
check for license path
if it is C: change it to d using environmental settings
10) Change Environmental variables
control panel
system properties
PPMT_lic_path
D:\powerpath_version\filename
11)
verify rpowermt version
12) Verify LMTOOLS
Verify service name should be only LMTOOLS
programfiles(86)\emc\elms\
13) register esx hosts
Solution Enabler Installation (SE Install)
1. Stop ECOM service.
2. Make a backup of these folders:
On Windows:
C:\Program Files\EMC\ECIM\ECOM\conf\cst
C:\Program Files\EMC\ECIM\ECOM\conf\ssl
3. Uninstall existing version of SE and SMI provider. Sometimes we need to delete the symapi folders manually and then reboot the host
4. Install SE with SMI-S provider
Reboot the host and start the required daemons
5.Copy the backup(you made) folders mentioned in step 2 with the .
6. Start ECOM service.
7. Put back the deamon_options and deamon_users files back without replacing them
8. Restart the all the daemons order being storapid first
And verify storsrvd is running
Unisphere Install
Unisphere for VMAX: on D drive
Run the install.exe file --> Takes around 30 mins and install Flash if needed
Register the array for collecting stats
Login-->Performance tab-->settings-->select array and register
Requirement:
RAM-8Gb available
Disk space-25Gb available
Alert suppression:
AS a part of matrix upgrade, unisphere is getting upgraded to new code 1.6. As a part of installation process, there might be some alerts generated that needs
to be suppressed.
Implementation steps:
1. Log into the arms server "arms.test.com"
2. Uninstall SMAS 1.3.3 application through control panel
3. Run the Installation file "UNIVMAX_V1.6.0.8_WINDOWS_X86_64". Select D drive
4. After installation, Register the array into Unisphere for collecting stats as shown below
i) Login to Unisphere using "https://192.168.10.10:8443/"
ii) Select Performance tab
iii) Select settings
iv) Select the VMAX array and click register
VMAX - Environment Status (drive, Hardware)
check environment details like status of hardware and disks
symcfg list -env_data
symdisk list -failed
symcfg list -env_data -service_state notnormal
symcfg list -env_data
symdisk list -failed
symcfg list -env_data -service_state notnormal
VMAX - VLUN Migration
Vlun migration commands
symcfg -sid 60 list -tdev -bound -detail -dev 9A9 -gb
symmigrate -name new_migration query -sid 60
symmigrate list
symmigrate -sid 47 -name new_migration1 -f file_name -tgt_pool FC_poolname validate
symmigrate -sid 47 -name new_migration1 -f file_name -tgt_pool FC_poolname establish
notepad file_name.txt
dir - to list files
symdev -sid 40 pin dev_id
symcfg -sid list -pool -thin -detail -gb
symcfg -sid 60 list -tdev -bound -detail -dev 9A9 -gb
symmigrate -name new_migration query -sid 60
symmigrate list
symmigrate -sid 47 -name new_migration1 -f file_name -tgt_pool FC_poolname validate
symmigrate -sid 47 -name new_migration1 -f file_name -tgt_pool FC_poolname establish
notepad file_name.txt
dir - to list files
symdev -sid 40 pin dev_id
symcfg -sid list -pool -thin -detail -gb
Friday, May 2, 2014
Isilon - truss command - tracking status
truss is a solaris command work on BSD's (isilon OS) which track the work flow of a command execution
truss -fea isi sync policies list
truss -fea "command"
The equivalent command in Linux is strace
truss -fea isi sync policies list
truss -fea "command"
The equivalent command in Linux is strace
Linux - Print First row
server_mount server-2 | sed 's/\|/ /'|awk '{print $1}'
Remove spl characters < >
server_mount server_2 |sed 's/\|//'awk '{print $1}' | sed 's/[<>]//g'
Remove spl characters < >
server_mount server_2 |sed 's/\|//'awk '{print $1}' | sed 's/[<>]//g'
Thursday, May 1, 2014
VG8 - nas_checkup automatic scheduler
Remove automatic nas_checkup schedule from VG8
cat /nas/site/cron.d/nas_sys
remove following line
51 3 * * 7 root /nas/tools/auto_checkup > /dev/null 2>&1
cat /nas/site/cron.d/nas_sys
remove following line
51 3 * * 7 root /nas/tools/auto_checkup > /dev/null 2>&1
Subscribe to:
Posts (Atom)