Tuesday, June 15, 2021
Powershell script to collect OS details
Monday, June 14, 2021
Powershell Ping report status script
Sunday, June 13, 2021
Ansible playbook to delete selected VMs from file.
Powershell script to disable/ enable vmwaretool with report status.
Saturday, June 12, 2021
Powershell script to collect hostname from ipaddress V2
Ansible playbook to delete multiple vms
Friday, June 11, 2021
Powershell script to collect gateway ip of remote window system
Powershell script to collect hostname from ipaddress
Thursday, June 10, 2021
vmware tool auto update enable disable powershell code
Wednesday, June 9, 2021
SAN switch latency issue
Major issue on this error, disable port immediately if getting below error.
2021/06/08-13:56:17, [AN-1003], 1281572, SLOT 6 | FID 128, WARNING, switchname1, Latency bottleneck at slot 9, port 11. 10.33 percent of last 300 seconds were affected. Avg. time b/w transmits 1.0000 us.
2021/07/20-21:06:38, [AN-1010], 11564, SLOT 5 | FID 128, WARNING, backboneswitch, Severe latency bottleneck detected at slot 1 port 23.
investigate:
2021/06/08-14:40:22, [AN-1010], 1124481, SLOT 6 | FID 128, WARNING, switchname1, Severe latency bottleneck detected at slot 10 port 0.
investigate:
2021/06/09-11:54:34, [AN-1004], 1124531, SLOT 6 | FID 128, WARNING, switchname1, Slot 9, port 22 is a congestion bottleneck. 54.33 percent of last 300 seconds were affected by this condition.
check above logs by below command :
errdump |grep -i latency
errdump |grep -i bottleneck
errdump |grep -i congestion
check error on ports:
porterrshow (check crc, disc c3 errors)
check port flapping :
fabriclog -s
Tuesday, June 8, 2021
HP C7000 blade
HP C7000 blade mazenine card configuration
server mazenine 1, brocade 3-4
server mazenine 2, brocade 5-6
server mazenine 3, brocade 7-8
To collect naa id on linux
to collect naa id on linux
https://www.thegeekdiary.com/how-to-identifymatch-lun-presented-from-san-with-underlying-os-disk/
To get WWID of LUN you can use the /dev/disk/by-id/ file:
# ls -la /dev/disk/by-id/
scsi-3600508b400105e210000900000490000 -> ../../dm-1
Now its easier to understand that dm-1 has WWID 3600508b400105e210000900000490000
Saturday, June 5, 2021
Use of register and debug in Ansible
Ansible playbook to add a line in a file
Ansible Handler use
use windows facts in ansible
Friday, June 4, 2021
To enable kerberos authentication for ansible.
Configure VMware.PowerCLI on powershell
Install-Module -Name VMware.PowerCLI
Set-PowerCLIConfiguration -Scope User -InvalidCertificateAction warn
To enable virtualization support on VM
To enable virtualization support on VM
add below mentioned line in vm vmx file
vhv.enable = "TRUE"
####################################
evcCompatibilityMode = "FALSE"
monitor.phys_bits_used = "40"
vmotion.checkpointFBSize = "4194304"
cleanShutdown = "TRUE"
softPowerOff = "FALSE"
tools.syncTime = "FALSE"
vhv.enable = "TRUE"
ide1:0.startConnected = "FALSE"
ide1:0.allowGuestConnectionControl = "TRUE"
config.readOnly = "FALSE"
ethernet0.virtualDev = "vmxnet3"
ethernet0.networkName = "VM Network"
ethernet0.addressType = "generated"
ethernet0.uptCompatibility = "TRUE"
ethernet0.present = "TRUE"
ethernet0.pciSlotNumber = "160"
ethernet0.generatedAddress = "00:0c:29:de:59:84"
ethernet0.generatedAddressOffset = "0"
ethernet1.pciSlotNumber = "192"
ethernet1.virtualDev = "vmxnet3"
ethernet1.networkName = "VM Network"
ethernet1.addressType = "generated"
ethernet1.uptCompatibility = "true"
ethernet1.present = "TRUE"
ethernet1.generatedAddress = "00:0c:29:de:59:8e"
ethernet1.generatedAddressOffset = "10"
extendedConfigFile = "ESXi6.7.vmxf"
vhv.enable = "TRUE"
Ansible Playbook to create or remove windows directory
To enable Sudo access on particular without password.
edit visudo file on ubuntu and centos
add this line to get sudo access on ansible account without password
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
ansible ALL=(ALL) NOPASSWD: ALL
now for sudo access need to run command with -b
ansible node -b -a "reboot"
ansible node* -m setup to check node info
To enable key for connect password less node from ansible.
To Enable ethernet and make persistent in CentOS
CENTOS :
ip r to check ip address
sudo ip addr add 10.102.66.200/24 dev enp0s25
nmcli to check ethernet
nmcli dev connect ethernetname to enable port
ip link set dev enp0s25 up
Open the configuration file for your network interface.
vi /etc/sysconfig/network-scripts/ifcfg-eth0
Add the following settings to the file:
DEVICE=enp3s0
ONBOOT=yes
IPADDR=192.168.1.10
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
To enable winRM
Get-WmiObject -Class Win32_ComputerSystem -ComputerName 192.168.100.100 -Credential domain\mywmiuser
VM disk info powershell script
LUN report – datastore, RDM and node visibility
VM clone create powershell script
#$srcvms = get-vm -location "LAB" | select -expandproperty Name (for complete cluster or DC)
$srcvms = Get-Content c:\ry\ansible\vmname.txt
Foreach ($srcvm in $srcvms) {
#$srvcvms_strip = $srcvm -replace "LAB_"
new-vm -name "Clone_$srcvm" -vm $srcvm -vmhost esx01 -datastore "datastore11" -DiskStorageFormat Thin
}
#####################
To run cloning on all VMs at a time use below.
########################
#$srcvms = get-vm -location "LAB" | select -expandproperty Name (for complete cluster or DC)
$srcvms = Get-Content c:\ry\ansible\vmname.txt
Foreach ($srcvm in $srcvms) {
#$srvcvms_strip = $srcvm -replace "LAB_"
new-vm -name "Clone_$srcvm" -vm $srcvm -vmhost esx01 -datastore "datastore11" -DiskStorageFormat Thin -RunAsync
}
vol clone and ndmpcopy
vol clone create smtp_attachment_T2_001_sv_restore -s none -b source_smtp_attachment_T2_001_sv snapshotname_01
run below where you want to restore file.
ndmpcopy -sa root:password sourcebackupfiler:/vol/smtp_attachment_T2_001_sv_restore/qt01/tc/transfertFTP/numTransmission.xml /vol/test01/restore