diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index 17628b828..551976e18 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -20,7 +20,7 @@ B I {B|B|B|B|B|B|B =head2 VMware specific: -B I +B I [B<-t>] =head1 B @@ -94,6 +94,10 @@ Print help. Print version. +=item B<-t> + +Set the values in the vm table to what vCenter has for the indicated nodes. + =back =head1 B diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index a96074473..a8ecb8af6 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -565,6 +565,24 @@ sub inv { return; } } + + @ARGV= @{$args{exargs}}; + require Getopt::Long; + my $tableUpdate; + my $rc = GetOptions( + 't' => \$tableUpdate, + ); + $SIG{__WARN__} = 'DEFAULT'; + + if(@ARGV) { + xCAT::SvrUtils::sendmsg("Invalid arguments: @ARGV", $output_handler); + return; + } + + if(!$rc) { + return; + } + my $vmview = $args{vmview}; my $moref = $vmview->{mo_ref}->value; xCAT::SvrUtils::sendmsg("Managed Object Reference: $moref", $output_handler,$node); @@ -574,6 +592,12 @@ sub inv { xCAT::SvrUtils::sendmsg("CPUs: $cpuCount", $output_handler,$node); my $memory = $vmview->config->hardware->memoryMB; xCAT::SvrUtils::sendmsg("Memory: $memory MB", $output_handler,$node); + + if($tableUpdate){ + my $vm=xCAT::Table->new('vm',-create=>1); + $vm->setNodeAttribs($node,{cpus=>$cpuCount, memory=>$memory}); + } + my $devices = $vmview->config->hardware->device; my $label; my $size;