added displaying of host which vm belongs to; added change for rmigrate; fixed issue of cpu configure during mkvm/chvm

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14255 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
daniceexi 2012-11-06 08:51:40 +00:00
parent 09eff12ed4
commit edeac5de74

View File

@ -909,6 +909,7 @@ my $display = {
'stateless' => ["stateless"],
'placement_policy' => ["placement_policy/affinity"],
'memory_guaranteed' => ["memory_policy/guaranteed"],
'host' => ["host", "id", "hosts", "/host/name"],
},
'templates' => {
'memory' => ["memory"],
@ -2001,7 +2002,7 @@ sub mkvm {
if ($myvment->{cpus}) {
my ($socketnum, $corenum) = split(':', $myvment->{cpus});
unless ($corenum) {$corenum = 1;}
$cpuele = "<cpu><topology cores=\"$socketnum\" sockets=\"$corenum\"/></cpu>";
$cpuele = "<cpu><topology cores=\"$corenum\" sockets=\"$socketnum\"/></cpu>";
} elsif (!$hastpl) {
$cpuele = "<cpu><topology cores=\"1\" sockets=\"1\"/></cpu>"
}
@ -2490,7 +2491,7 @@ sub chvm {
if ($myvment->{cpus}) {
my ($socketnum, $corenum) = split(':', $myvment->{cpus});
unless ($corenum) {$corenum = 1;}
$cpuele = "<cpu><topology cores=\"$socketnum\" sockets=\"$corenum\"/></cpu>";
$cpuele = "<cpu><topology cores=\"$corenum\" sockets=\"$socketnum\"/></cpu>";
}
# configure bootorder
@ -2811,7 +2812,7 @@ sub rmigrate {
my $api = "/api/vms/$vmid/migrate";
my $method = "POST";
my $content = "<action><host id=\"$hostid\"/></action>";
my $content = "<action><host id=\"$hostid\"/><force>true</force></action>";
my $request = genreq($ref_rhevm, $method, $api, $content);
my $response;
($rc, $response) = send_req($ref_rhevm, $request->as_string());
@ -3049,7 +3050,11 @@ sub search_src {
if ($type eq "vms") {
$idstr = "/vms/vm";
} elsif ($type eq "hosts") {
$idstr = "/hosts/host";
if ($individual) {
$idstr = "/host";
} else {
$idstr = "/hosts/host";
}
} elsif ($type eq "templates") {
$idstr = "/templates/template";
} elsif ($type eq "storagedomains") {