From ba5b5871d891cbd46a57b91c3da0a3319ae35b8b Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 21 Feb 2012 19:53:36 +0000 Subject: [PATCH] Preserve extra datastore and = directives in vm.storage on rinv -t sync up git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11660 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index c3f3f3ffd..fd92faff0 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -712,6 +712,7 @@ sub inv { if ($tableUpdate) { my $cfgdatastore; foreach (@{$vmview->layoutEx->file}) { + #TODO, track ALL layoutEx->file.... if ($_->type eq 'config') { $_->name =~ /\[([^\]]+)\]/; $cfgdatastore = $hyphash{$hyp}->{datastoreurlmap}->{$1}; @@ -724,6 +725,9 @@ sub inv { } elsif ($tablecfg{vm}->{$node}->[0]->{storage}) { #check the config file explicitly, ignore the rest $cfgkey='storage'; } + my $configuration = $tablecfg{vm}->{$node}->[0]->{$cfgkey}; #TODO: prune urls that map to no layoutEx->file entries anymore + my $configappend = $configuration; + $configappend =~ s/^[^,=]*//; $tablecfg{vm}->{$node}->[0]->{$cfgkey} =~ m!nfs://([^/]+)/!; my $tablecfgserver =$1; my $cfgserver = inet_aton($tablecfgserver); @@ -732,7 +736,7 @@ sub inv { my $cfgurl = $tablecfg{vm}->{$node}->[0]->{$cfgkey}; $cfgurl =~ s/$tablecfgserver/$cfgserver/; if ($cfgurl ne $cfgdatastore) { - $updatehash{$cfgkey} = $cfgdatastore; + $updatehash{$cfgkey} = $cfgdatastore.$configappend; } } }