From 4f686ebc9e6caf337920ff87d843bd8f2f4ff71d Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 5 Oct 2016 16:38:41 -0400 Subject: [PATCH] Display errors for rmvm and mkvm --- .../guides/admin-guides/references/man1/mkvm.1.rst | 12 +++++------- xCAT-client/pods/man1/mkvm.1.pod | 12 +++++------- xCAT-server/lib/xcat/plugins/kvm.pm | 9 +++++++-- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/mkvm.1.rst b/docs/source/guides/admin-guides/references/man1/mkvm.1.rst index 6791a9ce4..5e289a76a 100644 --- a/docs/source/guides/admin-guides/references/man1/mkvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkvm.1.rst @@ -81,13 +81,13 @@ For PPC (with HMC) specific: ============================ -The first form of mkvm command creates new partition(s) with the same profile/resources as the partition specified by \ *singlenode*\ . The -i and \ *noderange*\ specify the starting numeric partition number and the \ *noderange*\ for the newly created partitions, respectively. The LHEA port numbers and the HCA index numbers will be automatically increased if they are defined in the source partition. +The first form of \ **mkvm**\ command creates new partition(s) with the same profile/resources as the partition specified by \ *singlenode*\ . The -i and \ *noderange*\ specify the starting numeric partition number and the \ *noderange*\ for the newly created partitions, respectively. The LHEA port numbers and the HCA index numbers will be automatically increased if they are defined in the source partition. The second form of this command duplicates all the partitions from the source specified by \ *profile*\ to the destination specified by \ *destcec*\ . The source and destination CECs can be managed by different HMCs. Please make sure the nodes in the \ *noderange*\ is defined in the \ *nodelist*\ table and the \ *mgt*\ is set to 'hmc' in the \ *nodehm*\ table before running this command. -Please note that the mkvm command currently only supports creating standard LPARs, not virtual LPARs working with VIOS server. +Please note that the \ **mkvm**\ command currently only supports creating standard LPARs, not virtual LPARs working with VIOS server. For PPC (using Direct FSP Management) specific: @@ -103,16 +103,14 @@ For KVM and Vmware: =================== -The mkvm command creates new virtual machine(s) with the \ *disksize*\ size of hard disk, \ *memsize*\ size of memory and \ *cpucount*\ number of cpu. - -For KVM: If \ **-f | -**\ **-force**\ is specified, the storage will be destroyed first if it existed. +The \ **mkvm**\ command creates new virtual machine(s) with the \ *disksize*\ size of hard disk, \ *memsize*\ size of memory and \ *cpucount*\ number of cpu. For zVM: ======== -The first form of mkvm creates a new virtual machine based on a directory entry. +The first form of \ **mkvm**\ creates a new virtual machine based on a directory entry. The second form of this creates a new virtual machine with the same profile/resources as the specified node (cloning). @@ -158,7 +156,7 @@ OPTIONS \ **-f|-**\ **-force**\ - If \ **-f|-**\ **-force**\ is specified, the storage will be destroyed first if it existed. + If the storage already exists, remove it before creating a new virtual machine. diff --git a/xCAT-client/pods/man1/mkvm.1.pod b/xCAT-client/pods/man1/mkvm.1.pod index b4d4f0e19..b04811dac 100644 --- a/xCAT-client/pods/man1/mkvm.1.pod +++ b/xCAT-client/pods/man1/mkvm.1.pod @@ -42,13 +42,13 @@ B I [I] [B I] =head2 For PPC (with HMC) specific: -The first form of mkvm command creates new partition(s) with the same profile/resources as the partition specified by I. The -i and I specify the starting numeric partition number and the I for the newly created partitions, respectively. The LHEA port numbers and the HCA index numbers will be automatically increased if they are defined in the source partition. +The first form of B command creates new partition(s) with the same profile/resources as the partition specified by I. The -i and I specify the starting numeric partition number and the I for the newly created partitions, respectively. The LHEA port numbers and the HCA index numbers will be automatically increased if they are defined in the source partition. The second form of this command duplicates all the partitions from the source specified by I to the destination specified by I. The source and destination CECs can be managed by different HMCs. Please make sure the nodes in the I is defined in the I table and the I is set to 'hmc' in the I table before running this command. -Please note that the mkvm command currently only supports creating standard LPARs, not virtual LPARs working with VIOS server. +Please note that the B command currently only supports creating standard LPARs, not virtual LPARs working with VIOS server. =head2 For PPC (using Direct FSP Management) specific: @@ -58,13 +58,11 @@ If no option is specified, a partition using the parameters specified with attri =head2 For KVM and Vmware: -The mkvm command creates new virtual machine(s) with the I size of hard disk, I size of memory and I number of cpu. +The B command creates new virtual machine(s) with the I size of hard disk, I size of memory and I number of cpu. -For KVM: If B<-f>|B<--force> is specified, the storage will be destroyed first if it existed. - =head2 For zVM: -The first form of mkvm creates a new virtual machine based on a directory entry. +The first form of B creates a new virtual machine based on a directory entry. The second form of this creates a new virtual machine with the same profile/resources as the specified node (cloning). @@ -96,7 +94,7 @@ The option I is used to specify the partition that will be created is a VI =item B<-f|--force> -If B<-f|--force> is specified, the storage will be destroyed first if it existed. +If the storage already exists, remove it before creating a new virtual machine. =item B<-i> diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index 9832e158f..0cf92c3a7 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -1760,6 +1760,10 @@ sub rmvm { } } else { $currxml = $confdata->{kvmnodedata}->{$node}->[0]->{xml}; + unless ($currxml) { + xCAT::SvrUtils::sendmsg([ 1, "Cannot remove guest, no such vm" ], $callback, $node); + return; + } } if ($purge and $currxml) { my $deadman = $parser->parse_string($currxml); @@ -3048,8 +3052,9 @@ sub mkvm { @return = createstorage($diskname, $mastername, $disksize, $confdata->{vm}->{$node}->[0], $force); }; if ($@) { - if ($@ =~ /ath already exists/) { - return 1, "Storage creation request conflicts with existing file(s)"; + if ($@ =~ /Path (\S+) already exists at /) { + return 1, "Storage creation request conflicts with existing file(s) $1 (use mkvm with -f argument to remove)"; + } else { return 1, "Unknown issue $@"; }