mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 03:12:30 +00:00 
			
		
		
		
	-Try to honor the now prefered nicmodel/storagemodel columns in vm
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7231 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -25,7 +25,7 @@ sub grab_table_data{ #grab table data relevent to VM guest nodes | ||||
|   if ($vpdtab) { | ||||
|       $cfghash->{vpd} = $vpdtab->getNodesAttribs($noderange,['uuid']); | ||||
|   } | ||||
|   $cfghash->{vm} = $vmtab->getNodesAttribs($noderange,['node','host','migrationdest','cfgstore','storage','memory','cpus','nics','bootorder','virtflags']); | ||||
|   $cfghash->{vm} = $vmtab->getNodesAttribs($noderange,['node','host','migrationdest','cfgstore','storage','storagemodel','memory','cpus','nics','nicmodel','bootorder','virtflags']); | ||||
|   my $mactab = xCAT::Table->new("mac",-create=>1); | ||||
|   my $nrtab= xCAT::Table->new("noderes",-create=>1); | ||||
|   $cfghash->{mac} = $mactab->getAllNodeAttribs(['mac'],1); | ||||
|   | ||||
| @@ -1955,6 +1955,8 @@ sub create_storage_devs { | ||||
|     my %disktocont; | ||||
|     my $dev; | ||||
|     my @storelocs = split /,/,$tablecfg{vm}->{$node}->[0]->{storage}; | ||||
|     my $globaldisktype = $tablecfg{vm}->{$node}->[0]->{storagemodel}; | ||||
|     unless ($globaldisktype) { $globaldisktype='ide'; } | ||||
|     #number of devices is the larger of the specified sizes (TODO: masters) or storage pools to span | ||||
|     my $numdevs = (scalar @storelocs > scalar @sizes ? scalar @storelocs : scalar @sizes); | ||||
|     while ($numdevs-- > 0) { | ||||
| @@ -1963,7 +1965,7 @@ sub create_storage_devs { | ||||
|         my $disksize = shift @sizes; | ||||
|         unless (scalar @sizes) { @sizes = ($disksize); } #if we emptied the array, stick the last entry back on to allow it to specify all remaining disks | ||||
|         $disksize = getUnits($disksize,'G',1024); | ||||
|         $disktype = 'ide'; | ||||
|         $disktype = $globaldisktype; | ||||
|         if ($storeloc =~ /=/) { | ||||
|             ($storeloc,$disktype) = split /=/,$storeloc; | ||||
|         } | ||||
|   | ||||
| @@ -283,7 +283,11 @@ sub build_diskstruct { | ||||
|             my $diskhash; | ||||
|             $disk =~ s/=(.*)//; | ||||
|             my $model = $1; | ||||
|             unless ($model) { $model = 'ide'; } | ||||
|             unless ($model) { | ||||
|                 #if not defined, model will stay undefined like above | ||||
|                 $model = $confdata->{vm}->{$node}->[0]->{storagemodel} | ||||
|                 unless ($model) { $model = 'ide'; } #if still not defined, ide | ||||
|             } | ||||
|             my $prefix='hd'; | ||||
|             if ($model eq 'virtio') { | ||||
|                 $prefix='vd'; | ||||
| @@ -427,6 +431,9 @@ sub build_nicstruct { | ||||
|         } | ||||
|         $nic =~ s/.*://; #the detail of how the bridge was built is of no | ||||
|                         #interest to this segment of code | ||||
|         if ($confdata->{vm}->{$node}->[0]->{nicmodel}) { | ||||
|             $type = $confdata->{vm}->{$node}->[0]->{nicmodel}; | ||||
|         } | ||||
|         if ($nic =~ /=/) { | ||||
|             ($nic,$type) = split /=/,$nic,2; | ||||
|         } | ||||
| @@ -822,6 +829,10 @@ sub createstorage { | ||||
|     } | ||||
|     $filename=~s/=(.*)//; | ||||
|     my $model=$1; | ||||
|     unless ($model) { | ||||
|         #if not defined, model will stay undefined like above | ||||
|         $model = $cfginfo->{storagemodel}; | ||||
|     } | ||||
|     my $prefix='hd'; | ||||
|     if ($model eq 'scsi') { | ||||
|         $prefix='sd'; | ||||
| @@ -883,6 +894,10 @@ sub chvm { | ||||
|         $location =~ s/,.*//; #no comma specified parameters are valid | ||||
|         $location =~ s/=(.*)//; #store model if specified here | ||||
|         my $model = $1; | ||||
|         unless ($model) { | ||||
|             #if not defined, model will stay undefined like above | ||||
|             $model = $confdata->{vm}->{$node}->[0]->{storagemodel} | ||||
|         } | ||||
|         my $prefix='hd'; | ||||
|         if ($model eq 'scsi') { | ||||
|             $prefix='sd'; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user