From 42ac6c627c2e77ccd8295e5218c52dd5a9158447 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 8 Jun 2010 20:56:51 +0000 Subject: [PATCH] -Add selection by scsi id for disk deletion/resize -Report scsi id in rinv output for disks git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6401 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index 580b97af5..6567152aa 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -462,9 +462,9 @@ sub inv { $label = $device->deviceInfo->label; if($label =~ /^Hard disk/) { + $label .= " (d".$device->unitNumber.")"; $size = $device->capacityInKB / 1024; $fileName = $device->backing->fileName; - sendmsg("$label: $size MB @ $fileName",$node); } elsif ($label =~ /Network/) { sendmsg("$label: ".$device->macAddress,$node); @@ -474,7 +474,7 @@ sub inv { #changes the memory, number of cpus and device size -#can also add and remove disks +#can also add,resize and remove disks sub chvm { my %args = @_; my $node = $args{node}; @@ -684,7 +684,12 @@ sub getDiskByLabel { if($cmdLabel eq $label) { return $device; + } elsif (($label =~ /^Hard disk/) and ($cmdLabel =~ /^d(\d+)/)) { + if ($device->unitNumber == $1) { + return $device; + } } + } return undef; } @@ -692,7 +697,7 @@ sub getDiskByLabel { #takes a label for a hard disk and prepends "Hard disk " if it's not there already sub commandLabel { my $label = shift; - if($label =~ /^Hard disk/) { + if(($label =~ /^Hard disk/) or ($label =~ /^d\d+/)) { return $label; } return "Hard disk ".$label;