From d7d36bd23ff8badd014e532ad9600cd49f50103c Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 20 Aug 2008 16:48:23 +0000 Subject: [PATCH] -Have Xen plugin populate virtual disks from vm table git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2047 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/xen.pm | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/xen.pm b/xCAT-server/lib/xcat/plugins/xen.pm index 64dcc55f0..77bba497b 100644 --- a/xCAT-server/lib/xcat/plugins/xen.pm +++ b/xCAT-server/lib/xcat/plugins/xen.pm @@ -88,12 +88,22 @@ sub build_oshash { } sub build_diskstruct { - my @returns; + my @returns=(); my $diskhash; - $diskhash->{type}='file'; - $diskhash->{source}->{file}="/vms/$node"; - $diskhash->{target}->{dev}='hda'; - push @returns,$diskhash; + my $currdev; + my @suffixes=('a'..'z'); + my $suffidx=0; + if (defined $vmhash->{$node}->[0]->{storage}) { + my $disklocs=$vmhash->{$node}->[0]->{storage}; + my @locations=split /\|/,$disklocs; + foreach (@locations) { + $currdev='sd'.$suffixes[$suffidx++]; + $diskhash->{type}='file'; + $diskhash->{source}->{file}=$_; #"/vms/$node"; + $diskhash->{target}->{dev}=$currdev; + push @returns,$diskhash; + } + } return \@returns; } sub getNodeUUID {