diff --git a/perl-xCAT/xCAT/zvmUtils.pm b/perl-xCAT/xCAT/zvmUtils.pm index 7c0c163a5..14df715cc 100644 --- a/perl-xCAT/xCAT/zvmUtils.pm +++ b/perl-xCAT/xCAT/zvmUtils.pm @@ -1014,14 +1014,20 @@ sub getUserProfile { # Set directory where executables are on zHCP my $hcpDir = "/opt/zhcp/bin"; + my $out; + # Set directory for cache - my $cache = '/var/opt/zhcp/.vmapi/.cache'; + my $cache = '/var/opt/zhcp/cache'; + # If the cache directory does not exist + if (!(`ssh $hcp "test -d $cache && echo Exists"`)) { + # Create cache directory + $out = `ssh $hcp "mkdir -p $cache"`; + } # Set output file name my $file = "$cache/$profile.profile"; # If a cache for the user profile exists - my $out; if (`ssh $hcp "ls $file"`) { # Get current Epoch diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index e7a2822a3..66b22206a 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -1488,7 +1488,7 @@ sub listVM { my ( $callback, $node, $args ) = @_; # Set cache directory - my $cache = '/var/opt/zhcp/.vmapi/.cache'; + my $cache = '/var/opt/zhcp/cache'; # Get node properties from 'zvm' table my @propNames = ( 'hcp', 'userid' ); @@ -1512,6 +1512,12 @@ sub listVM { # Get disk pool names if ( $args->[0] eq "--diskpoolnames" ) { + # If the cache directory does not exist + if (!(`ssh $hcp "test -d $cache && echo Exists"`)) { + # Create cache directory + $out = `ssh $hcp "mkdir -p $cache"`; + } + my $file = "$cache/diskpoolnames"; # If a cache for disk pool names exists