Script to Rescan HBA and iSCSI Adapters
1.0 Overview
Here's a useful script to rescan ESX host LUN's or iSCSI targets that you could schedule as needed.
#!/usr/bin/perl -w
#Filename: rescan-hbas.pl
#No warranty is provided with this scriptuse strict;
my @hbas = `/usr/sbin/esxcfg-info \| grep vmkernel -i \| grep hba \| awk -F\. \{\'print \$29\'\}`;
print "The following HBAs were detected on this system:\n";
print "\t@hbas";
foreach my $hba (@hbas) {
system("/usr/sbin/esxcfg-rescan $hba");
}
print "Checking to see if SW iSCSI is in use....";
my $iscsi = `/usr/sbin/esxcfg-swiscsi -q`;
chomp ($iscsi);
print "$iscsi\n";
if ($iscsi eq "Software iSCSI is enabled") {
system("/usr/sbin/esxcfg-swiscsi -s")
}
- Nil
- Nil
Spotlight:
VMware Documentation Downloader v11.08.30
Updated for vSphere 5 - A free tool for those on the move who need information FAST
vSphere 5 License Entitlement Changes
See what has changed in the license entitlement in vSphere 5?
Thin Client vs Zero Client
The differences between Thin and Zero desktop clients for VDI
