From c153c74d365b0c4c018612d1d3318ae91255ebb5 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 8 Jun 2010 13:22:33 +0000 Subject: [PATCH] -Fix mkvm of new node failing to create a SCSI controller if required (induced by changes to implement chvm) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6383 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index ea57d2aa0..e304eb853 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -1736,7 +1736,9 @@ sub create_storage_devs { my $disktype = 'ide'; my $ideunitnum=0; my $scsiunitnum=0; + my $havescsicontroller=0; if (defined $existingScsiCont) { + $havescsicontroller=1; $scsicontrollerkey = $existingScsiCont->{key}; $scsiunitnum = $scsiUnit; } @@ -1803,17 +1805,17 @@ sub create_storage_devs { } #It *seems* that IDE controllers are not subject to require creation, so we skip it -# if ($havescsidevs) { #need controllers to attach the disks to -# foreach(0..$scsicontrollerkey) { -# $dev=VirtualLsiLogicController->new(key => $_, -# device => \@{$disktocont{$_}}, -# sharedBus => VirtualSCSISharing->new('noSharing'), -# busNumber => $_); -# push @devs,VirtualDeviceConfigSpec->new(device => $dev, -# operation => VirtualDeviceConfigSpecOperation->new('add')); -# -# } -# } + if ($havescsidevs and not $havescsicontroller) { #need controllers to attach the disks to + foreach(0..$scsicontrollerkey) { + $dev=VirtualLsiLogicController->new(key => $_, + device => \@{$disktocont{$_}}, + sharedBus => VirtualSCSISharing->new('noSharing'), + busNumber => $_); + push @devs,VirtualDeviceConfigSpec->new(device => $dev, + operation => VirtualDeviceConfigSpecOperation->new('add')); + + } + } return @devs; # my $ctlr = VirtualIDEController->new( }