2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 03:32:04 +00:00

Merge branch 'master' into ZVM_XCAT_DEV

This commit is contained in:
Chuck Brazie 2017-05-01 13:22:51 -04:00 committed by GitHub
commit 0732afd02e
25 changed files with 590 additions and 154 deletions

View File

@ -178,6 +178,7 @@ then
build_time=`date`
build_machine=`hostname`
commit_id=`git rev-parse --short HEAD`
commit_id_long=`git rev-parse HEAD`
package_dir_name=debs$REL
#TODO: define the core path and tarball name
@ -362,14 +363,15 @@ __EOF__
chmod 775 mklocalrepo.sh
#
# Add a buildinfo file under xcat-core to track information about the build
# Add a buildinfo file into the tar.bz2 file to track information about the build
#
buildinfo=$local_core_repo_path/buildinfo
echo "VERSION=$ver" > $buildinfo
echo "RELEASE=$xcat_release" >> $buildinfo
echo "BUILD_TIME=$build_time" >> $buildinfo
echo "BUILD_MACHINE=$build_machine" >> $buildinfo
echo "COMMIT_ID=$commit_id" >> $buildinfo
BUILDINFO=$local_core_repo_path/buildinfo
echo "VERSION=$ver" > $BUILDINFO
echo "RELEASE=$xcat_release" >> $BUILDINFO
echo "BUILD_TIME=$build_time" >> $BUILDINFO
echo "BUILD_MACHINE=$build_machine" >> $BUILDINFO
echo "COMMIT_ID=$commit_id" >> $BUILDINFO
echo "COMMIT_ID_LONG=$commit_id_long" >> $BUILDINFO
#create the xcat-core.list file

View File

@ -189,6 +189,7 @@ function setversionvars {
BUILD_TIME=`date`
BUILD_MACHINE=`hostname`
COMMIT_ID=`git rev-parse --short HEAD`
COMMIT_ID_LONG=`git rev-parse HEAD`
XCAT_RELEASE="snap$(date '+%Y%m%d%H%M')"
echo "$XCAT_RELEASE" >Release
}
@ -541,7 +542,7 @@ else
fi
#
# Add a VERSION file into the tar.bz2 file to track information about the build
# Add a buildinfo file into the tar.bz2 file to track information about the build
#
BUILDINFO=$XCATCORE/buildinfo
echo "VERSION=$VER" > $BUILDINFO
@ -549,6 +550,7 @@ echo "RELEASE=$XCAT_RELEASE" >> $BUILDINFO
echo "BUILD_TIME=$BUILD_TIME" >> $BUILDINFO
echo "BUILD_MACHINE=$BUILD_MACHINE" >> $BUILDINFO
echo "COMMIT_ID=$COMMIT_ID" >> $BUILDINFO
echo "COMMIT_ID_LONG=$COMMIT_ID_LONG" >> $BUILDINFO
echo "Creating $(dirname $DESTDIR)/$TARNAME ..."
if [[ -e $TARNAME ]]; then

View File

@ -19,7 +19,7 @@ SYNOPSIS
********
\ **clonevm**\ \ *noderange*\ [ \ **-t**\ \ *mastertobemade*\ | \ **-b**\ \ *master to base vms upon*\ ] \ **-d|-**\ **-detached -f|-**\ **-force**\
\ **clonevm**\ \ *noderange*\ [ \ **-t**\ \ *master_to_be_made*\ | \ **-b**\ \ *master_to_base_vms_upon*\ ] [ \ **-d|-**\ **-detached**\ ] [\ **-f|-**\ **-force**\ ]
***********
@ -31,15 +31,15 @@ Command to promote a VM's current configuration and storage to a master as well
performing the converse operation of creating VMs based on a master.
By default, attempting to create a master from a running VM will produce an error.
The force argument will request that a master be made of the VM anyway.
The \ **-**\ **-force**\ argument will request that a master be made of the VM anyway.
Also, by default a VM that is used to create a master will be rebased as a thin
clone of that master. If the force argument is used to create a master of a powered
on vm, this will not be done. Additionally, the detached option can be used to
clone of that master. If the \ **-**\ **-force**\ argument is used to create a master of a powered
on vm, this will not be done. Additionally, the \ **-**\ **-detached**\ option can be used to
explicitly request that a clone not be tethered to a master image, allowing the
clones to not be tied to the health of a master, at the cost of additional storage.
When promoting a VM's current state to master, all rleated virtual disks will be
When promoting a VM's current state to master, all related virtual disks will be
copied and merged with any prerequisite images. A master will not be tethered to
other masters.
@ -49,19 +49,48 @@ OPTIONS
*******
\ **-h|-**\ **-help**\ Display usage message.
\ **-b**\ The master to base the clones upon
\ **-h|-**\ **-help**\
Display usage message.
\ **-t**\ The target master to copy a single VM's state to
\ **-d**\ Explicitly request that the noderange be untethered from any masters.
\ **-b**\ \ *master_to_base_vms_upon*\
The master to base the clones upon
\ **-f**\ Force cloning of a powered on VM. Implies -d if the VM is on.
\ **-v|-**\ **-version**\ Command Version.
\ **-t**\ \ *master_to_be_made*\
The target master to copy a single VM's state to
\ **-d|-**\ **-detached**\
Explicitly request that the noderange be untethered from any masters.
\ **-f|-**\ **-force**\
Force cloning of a powered on VM. Implies \ **-d**\ if the VM is on.
\ **-v|-**\ **-version**\
Command Version.
\ **-V|-**\ **-verbose**\
Verbose output.
\ **-V|-**\ **-verbose**\ Verbose output.
************
@ -80,7 +109,7 @@ EXAMPLES
1. Creating a master named appserver from a node called vm1:
1. Creating a master named \ *appserver*\ from a node called \ *vm1*\ :
.. code-block:: perl
@ -90,7 +119,7 @@ EXAMPLES
2. Cleating 30 VMs from a master named appserver:
2. Cleating 30 VMs from a master named \ *appserver*\ :
.. code-block:: perl

View File

@ -19,7 +19,7 @@ SYNOPSIS
********
\ **imgcapture**\ \ *node*\ \ **-t | -**\ **-type**\ {\ **diskless | sysclone**\ } \ **-o | -**\ **-osimage**\ \ *osimage*\ [\ **-V | -**\ **-verbose**\ ]
\ **imgcapture**\ \ *node*\ \ **-t | -**\ **-type**\ {\ **diskless | sysclone**\ } \ **-o | -**\ **-osimage**\ \ *osimage*\ [\ **-i**\ \ *nodebootif*\ ] [\ **-n**\ \ *nodenetdrivers*\ ] [\ **-V | -**\ **-verbose**\ ]
\ **imgcapture**\ [\ **-h**\ | \ **-**\ **-help**\ ] | [\ **-v**\ | \ **-**\ **-version**\ ]
@ -31,9 +31,9 @@ DESCRIPTION
The \ **imgcapture**\ command will capture an image from one running diskful Linux node and create a diskless or diskful image for later use.
The \ **node**\ should be one diskful Linux node, managed by the xCAT MN, and the remote shell between MN and the \ **node**\ should have been configured. AIX is not supported.
The \ **node**\ should be one diskful Linux node, managed by the xCAT MN, and the remote shell between MN and the \ **node**\ should have been configured. AIX is not supported. VMs are not supported.
The \ **imgcapture**\ command supports two image types: \ **diskless**\ and \ **sysclone**\ . For the \ **diskless**\ type, it will capture an image from one running diskful Linux node, prepares the rootimg directory, kernel and initial rmadisks for the \ **liteimg**\ /\ **packimage**\ command to generate the statelite/stateless rootimg. For the \ **sysclone**\ type, it will capture an image from one running diskful Linux node, create an osimage which can be used to clone other diskful Linux nodes.
The \ **imgcapture**\ command supports two image types: \ **diskless**\ and \ **sysclone**\ . For the \ **diskless**\ type, it will capture an image from one running diskful Linux node, prepares the rootimg directory, kernel and initial ramdisks for the \ **liteimg**\ /\ **packimage**\ command to generate the statelite/stateless rootimg. For the \ **sysclone**\ type, it will capture an image from one running diskful Linux node, create an osimage which can be used to clone other diskful Linux nodes.
The \ **diskless**\ type:
@ -80,15 +80,13 @@ OPTIONS
The network interface the diskless node will boot over (e.g. eth0), which is used by the \ **genimage**\ command to generate initial ramdisks.
This is optional.
\ **-n**\ \ *nodenetdrivers*\
The driver modules needed for the network interface, which is used by the \ **genimage**\ command to generate initial ramdisks.
This is optional. By default, the \ **genimage**\ command can provide drivers for the following network interfaces:
By default, the \ **genimage**\ command can provide drivers for the following network interfaces:
For x86 or x86_64 platform:

View File

@ -29,7 +29,7 @@ DESCRIPTION
***********
The imgexport command will export an image that is being used by xCAT. To export images, you must have the images defined in the \ *osimage*\ table. All the columns in the \ *osimage*\ and \ *linuximage*\ tables will be exported. If kits are used in stateful or stateless images, \ *kit*\ , \ *kitcomponent*\ and \ *kitrepo*\ tables will be exported. In addition, the following files will also be exported.
The \ **imgexport**\ command will export an image that is being used by xCAT. To export images, you must have the images defined in the \ *osimage*\ table. All the columns in the \ *osimage*\ and \ *linuximage*\ tables will be exported. If kits are used in stateful or stateless images, \ *kit*\ , \ *kitcomponent*\ and \ *kitrepo*\ tables will be exported. In addition, the following files will also be exported.
For stateful:
x.pkglist
@ -61,7 +61,7 @@ For statelite:
where x is the name of the profile.
Any files specified by the -e flag will also be exported. If -p flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themsleves need to be manualy exported using -e flag.
Any files specified by the \ **-e**\ flag will also be exported. If \ **-p**\ flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themsleves need to be manualy exported using \ **-e**\ flag.
For statelite, the litefile table settings for the image will also be exported. The litetree and statelite tables are not exported.
@ -71,17 +71,42 @@ OPTIONS
*******
\ **-e|-**\ **-extra**\ \ *srcfile:destdir*\ Pack up extra files. If \ *destdir*\ is omitted, the destination directory will be the same as the source directory.
\ **-h|-**\ **-help**\ Display usage message.
\ **-e|-**\ **-extra**\ \ *srcfile:destdir*\
Pack up extra files. If \ *destdir*\ is omitted, the destination directory will be the same as the source directory.
\ **-p|-**\ **-postscripts**\ \ *node_name*\ Get the names of the postscripts and postbootscripts for the given node and pack them into the image.
\ **-v|-**\ **-verbose**\ Verbose output.
\ **-h|-**\ **-help**\
Display usage message.
\ *image_name*\ The name of the image. Use \ *lsdef -t*\ osimage to find out all the image names.
\ *destination*\ The output bundle file name.
\ **-p|-**\ **-postscripts**\ \ *node_name*\
Get the names of the postscripts and postbootscripts for the given node and pack them into the image.
\ **-v|-**\ **-verbose**\
Verbose output.
\ *image_name*\
The name of the image. Use \ **lsdef -t osimage**\ to find out all the image names.
\ *destination*\
The output bundle file name.
************

View File

@ -29,7 +29,7 @@ DESCRIPTION
***********
The imgimport command will import an image that has been exported by \ *imgexport*\ from xCAT. This is the easiest way to transfer/backup/, change or share images created by xCAT whether they be stateless or stateful. The bundle file will be unpacked in the current working directory. The xCAT configuration such as \ *osimage*\ and \ *linuximage*\ tables will then be updated.
The \ **imgimport**\ command will import an image that has been exported by \ **imgexport**\ from xCAT. This is the easiest way to transfer, backup, change or share images created by xCAT whether they be stateless or stateful. The bundle file will be unpacked in the current working directory. The xCAT configuration such as \ *osimage*\ and \ *linuximage*\ tables will then be updated.
For stateful, the following files will be copied to the appropriate directories.
x.pkglist
@ -61,15 +61,15 @@ For statelite, the following files will be copied to the appropriate directories
where x is the profile name.
Any extra files, included by --extra flag in the imgexport command, will also be copied to the appropriate directories.
Any extra files, included by \ **-**\ **-extra**\ flag in the \ **imgexport**\ command, will also be copied to the appropriate directories.
For statelite, the litefile table will be updated for the image. The litetree and statelite tables are not imported.
If -p flag is specified, the \ *postscripts*\ table will be updated with the postscripts and the postbootscripts names from the image for the nodes given by this flag.
If \ **-p**\ flag is specified, the \ *postscripts*\ table will be updated with the postscripts and the postbootscripts names from the image for the nodes given by this flag.
If -f flag is not specified, all the files will be copied to the same directories as the source. If it is specified, the old profile name x will be changed to the new and the files will be copied to the appropriate directores for the new profiles. For example, \ */opt/xcat/share/xcat/netboot/sles/x.pkglist*\ will be copied to \ */install/custom/netboot/sles/compute_new.pkglist*\ and \ */install/netboot/sles11/ppc64/x/kernel*\ will be copied to \ */install/netboot/sles11/ppc64/compute_new/kernel*\ . This flag is commonly used when you want to copy the image on the same xCAT mn so you can make modification on the new one.
If \ **-f**\ flag is not specified, all the files will be copied to the same directories as the source. If it is specified, the old profile name x will be changed to the new and the files will be copied to the appropriate directores for the new profiles. For example, \ */opt/xcat/share/xcat/netboot/sles/x.pkglist*\ will be copied to \ */install/custom/netboot/sles/compute_new.pkglist*\ and \ */install/netboot/sles11/ppc64/x/kernel*\ will be copied to \ */install/netboot/sles11/ppc64/compute_new/kernel*\ . This flag is commonly used when you want to copy the image on the same xCAT mn so you can make modification on the new one.
After this command, you can run the \ *nodeset*\ command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node depolyment.
After this command, you can run the \ **nodeset**\ command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node depolyment.
For stateful:
nodeset
@ -90,13 +90,30 @@ OPTIONS
*******
\ **-f|-**\ **-profile**\ \ *new_prof*\ Import the image with a new profile name.
\ **-h|-**\ **-help**\ Display usage message.
\ **-f|-**\ **-profile**\ \ *new_profile*\
Import the image with a new profile name.
\ **-p|-**\ **-postscripts**\ \ *nodelist*\ Import the postscripts. The postscripts contained in the image will be set in the postscripts table for \ *nodelist*\ .
\ **-v|-**\ **-verbose**\ Verbose output.
\ **-h|-**\ **-help**\
Display usage message.
\ **-p|-**\ **-postscripts**\ \ *nodelist*\
Import the postscripts. The postscripts contained in the image will be set in the postscripts table for \ *nodelist*\ .
\ **-v|-**\ **-verbose**\
Verbose output.
************

View File

@ -56,15 +56,15 @@ DESCRIPTION
***********
The lsvm command lists all partition profiles defined for the partitions specified in noderange. If noderange is a CEC, all the partitions associated with that CEC are displayed.
The \ **lsvm**\ command lists all partition profiles defined for the partitions specified in \ *noderange*\ . If \ *noderange*\ is a CEC, all the partitions associated with that CEC are displayed.
For PPC (using Direct FSP Management):
======================================
For Power 775(use option \ *--p775*\ to specify), lsvm lists all partition I/O slots information for the partitions specified in noderange. If noderange is a CEC, it gets the CEC's pump mode value, octant's memory interleaving value, the all the octants configure value, and all the I/O slots information.
For Power 775 (use option \ **-**\ **-p775**\ to specify), \ **lsvm**\ lists all partition I/O slots information for the partitions specified in \ *noderange*\ . If \ *noderange*\ is a CEC, it gets the CEC's pump mode value, octant's memory interleaving value, the all the octants configure value, and all the I/O slots information.
For DFM-managed (short for Direct FSP Management mode) normal power machine, lsvm lists the processor, memory, physical I/O slots, hugepage and BSR info for the specified partitions or CEC.
For DFM-managed (short for Direct FSP Management mode) normal power machine, \ **lsvm**\ lists the processor, memory, physical I/O slots, hugepage and BSR info for the specified partitions or CEC.
The pump mode value has the valid options:
1 - Node Pump Mode
@ -83,9 +83,9 @@ For KVM and VMware
==================
The virtual machines that defined in the hypervisor \ *noderange*\ will be displayed. \ *noderange*\ can only be hypervisor.
If \ *noderange*\ is a hypervisor, virtual machines defined on that hypervisor will be displayed. If \ *noderange*\ is a VM, details for that VM will be displayed.
Note: Only the virtual machine which is in power on state can be listed by lsvm command.
Note: Only the virtual machine which is in power on state can be listed by \ **lsvm**\ command.
For zVM:
@ -107,7 +107,7 @@ Display usage message.
\ **-v**\
Command Version.
Command version.
\ **-V**\
@ -157,7 +157,7 @@ Output is similar to:
lpar3: name=lpar3,lpar_name=lpar3,lpar_id=4,lpar_env=aixlinux,all_resources=0,min_mem=512, desired_mem=2048, max_mem=3072,min_num_huge_pages=0,desired_num_huge_pages=0,max_num_huge_pages=0,proc_mode=shared, min_proc_units=0.5,desired_proc_units=0.5,max_proc_units=0.5,min_procs=1,desired_procs=1,max_procs=1, sharing_mode=uncap,uncap_weight=128,shared_proc_pool_id=0,shared_proc_pool_name=DefaultPool,io_slots=none, lpar_io_pool_ids=none,max_virtual_slots=10, "virtual_serial_adapters=1/server/1/any//any/1,0/server/1/any//any/1", virtual_scsi_adapters=2/client/1/p6vios/4/1,virtual_eth_adapters=3/0/1//0/1,hca_adapters=none,boot_mode=norm,conn_monitoring=0,auto_start=0,power_ctrl_lpar_ids=none,work_group_id=none,redundant_err_path_reporting=0, bsr_arrays=0,lhea_logical_ports=none,lhea_capabilities=none,lpar_proc_compat_mode=default,electronic_err_reporting=null
2.To list all IVM-managed partitions associated with CEC cec01, enter:
2. To list all IVM-managed partitions associated with CEC cec01, enter:
.. code-block:: perl
@ -252,7 +252,7 @@ Output is similar to:
OctantID=7,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
6.To list the lparname of lpars, enter:
6. To list the lparname of lpars, enter:
.. code-block:: perl
@ -360,9 +360,9 @@ Output is similar to:
Available BSR array: 256
Note: The lines list in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class discription)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicate a physical I/O resource in normal power machine.
Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class discription)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine.
9.For DFM-managed partition on normal power machine, list out the detailed information:
9. For DFM-managed partition on normal power machine, list out the detailed information:
.. code-block:: perl

View File

@ -265,7 +265,11 @@ sub submit_request {
%sslargs,
);
} else {
print "warning: the client certificates under $homedir/.xcat/ are not setup correctly, please run '/opt/xcat/share/xcat/scripts/setup-local-client.sh"." $ENV{'USER'}' as 'root' to generate the client certificates; otherwise, the SSL connection between xcat client and xcatd will be setup without certificate verification and open to Man-In-The-Middle attacks.\n";
#Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client is deprecated!
#need to specify SSL_verify_mode => SSL_VERIFY_NONE explicitly
$client = IO::Socket::SSL->start_SSL($pclient,
SSL_verify_mode => SSL_VERIFY_NONE,
Timeout => 0,
);
}

View File

@ -327,14 +327,14 @@ my %usage = (
"Usage:
rflash [ -h|--help|-v|--version]
PPC (with HMC) specific:
rflash <noderange> -p <rpm_directory> [--activate concurrent | disruptive][-V|--verbose]
rflash <noderange> [--commit | --recover] [-V|--verbose]
rflash <noderange> -p <rpm_directory> [--activate {concurrent | disruptive}] [-V|--verbose]
rflash <noderange> {--commit | --recover} [-V|--verbose]
PPC (using Direct FSP Management) specific:
rflash <noderange> -p <rpm_directory> --activate <disruptive|deferred> [-d <data_directory>]
rflash <noderange> -p <rpm_directory> [--activate {disruptive|deferred}] [-d <data_directory>]
rflash <noderange> [--commit | --recover] [-V|--verbose]
rflash <noderange> [--bpa_acdl]
PPC64LE (using BMC Management) specific:
rflash <noderange> [-c | --check] <hpm_file>",
rflash <noderange> [-c | --check] [--retry=<count>] [-V] <hpm_file>",
"mkhwconn" =>
"Usage:
mkhwconn [-h|--help]

View File

@ -4,7 +4,7 @@ B<clonevm> - Create masters from virtual machines and virtual machines from mast
=head1 SYNOPSIS
B<clonevm> I<noderange> [ B<-t> I<mastertobemade> | B<-b> I<master to base vms upon> ] B<-d|--detached -f|--force>
B<clonevm> I<noderange> [ B<-t> I<master_to_be_made> | B<-b> I<master_to_base_vms_upon> ] [ B<-d|--detached>] [B<-f|--force>]
=head1 DESCRIPTION
@ -12,35 +12,51 @@ Command to promote a VM's current configuration and storage to a master as well
performing the converse operation of creating VMs based on a master.
By default, attempting to create a master from a running VM will produce an error.
The force argument will request that a master be made of the VM anyway.
The B<--force> argument will request that a master be made of the VM anyway.
Also, by default a VM that is used to create a master will be rebased as a thin
clone of that master. If the force argument is used to create a master of a powered
on vm, this will not be done. Additionally, the detached option can be used to
clone of that master. If the B<--force> argument is used to create a master of a powered
on vm, this will not be done. Additionally, the B<--detached> option can be used to
explicitly request that a clone not be tethered to a master image, allowing the
clones to not be tied to the health of a master, at the cost of additional storage.
When promoting a VM's current state to master, all rleated virtual disks will be
When promoting a VM's current state to master, all related virtual disks will be
copied and merged with any prerequisite images. A master will not be tethered to
other masters.
=head1 OPTIONS
=over 4
B<-h|--help> Display usage message.
=item B<-h|--help>
B<-b> The master to base the clones upon
Display usage message.
B<-t> The target master to copy a single VM's state to
=item B<-b> I<master_to_base_vms_upon>
B<-d> Explicitly request that the noderange be untethered from any masters.
The master to base the clones upon
B<-f> Force cloning of a powered on VM. Implies -d if the VM is on.
=item B<-t> I<master_to_be_made>
B<-v|--version> Command Version.
The target master to copy a single VM's state to
B<-V|--verbose> Verbose output.
=item B<-d|--detached>
Explicitly request that the noderange be untethered from any masters.
=item B<-f|--force>
Force cloning of a powered on VM. Implies B<-d> if the VM is on.
=item B<-v|--version>
Command Version.
=item B<-V|--verbose>
Verbose output.
=back
=head1 RETURN VALUE
@ -53,12 +69,12 @@ Any other value: An error has occurred.
=over 3
=item 1.
Creating a master named appserver from a node called vm1:
Creating a master named I<appserver> from a node called I<vm1>:
clonevm vm1 -t appserver
=item 2.
Cleating 30 VMs from a master named appserver:
Cleating 30 VMs from a master named I<appserver>:
clonevm vm1-vm30 -b appserver

View File

@ -4,7 +4,7 @@ B<imgcapture> - Captures an image from a Linux diskful node and create a diskles
=head1 SYNOPSIS
B<imgcapture> I<node> B<-t>|B<--type> {B<diskless>|B<sysclone>} B<-o>|B<--osimage> I<osimage> [B<-V>|B<--verbose>]
B<imgcapture> I<node> B<-t>|B<--type> {B<diskless>|B<sysclone>} B<-o>|B<--osimage> I<osimage> [B<-i> I<nodebootif>] [B<-n> I<nodenetdrivers>] [B<-V>|B<--verbose>]
B<imgcapture> [B<-h> | B<--help>] | [B<-v> | B<--version>]
@ -12,9 +12,9 @@ B<imgcapture> [B<-h> | B<--help>] | [B<-v> | B<--version>]
The B<imgcapture> command will capture an image from one running diskful Linux node and create a diskless or diskful image for later use.
The B<node> should be one diskful Linux node, managed by the xCAT MN, and the remote shell between MN and the B<node> should have been configured. AIX is not supported.
The B<node> should be one diskful Linux node, managed by the xCAT MN, and the remote shell between MN and the B<node> should have been configured. AIX is not supported. VMs are not supported.
The B<imgcapture> command supports two image types: B<diskless> and B<sysclone>. For the B<diskless> type, it will capture an image from one running diskful Linux node, prepares the rootimg directory, kernel and initial rmadisks for the B<liteimg>/B<packimage> command to generate the statelite/stateless rootimg. For the B<sysclone> type, it will capture an image from one running diskful Linux node, create an osimage which can be used to clone other diskful Linux nodes.
The B<imgcapture> command supports two image types: B<diskless> and B<sysclone>. For the B<diskless> type, it will capture an image from one running diskful Linux node, prepares the rootimg directory, kernel and initial ramdisks for the B<liteimg>/B<packimage> command to generate the statelite/stateless rootimg. For the B<sysclone> type, it will capture an image from one running diskful Linux node, create an osimage which can be used to clone other diskful Linux nodes.
The B<diskless> type:
@ -52,13 +52,11 @@ The osimage name.
The network interface the diskless node will boot over (e.g. eth0), which is used by the B<genimage> command to generate initial ramdisks.
This is optional.
=item B<-n> I<nodenetdrivers>
The driver modules needed for the network interface, which is used by the B<genimage> command to generate initial ramdisks.
This is optional. By default, the B<genimage> command can provide drivers for the following network interfaces:
By default, the B<genimage> command can provide drivers for the following network interfaces:
For x86 or x86_64 platform:

View File

@ -11,7 +11,7 @@ B<imgexport> I<image_name> [I<destination>] [[B<-e>|B<--extra> I<file:dir>] ...
=head1 DESCRIPTION
The imgexport command will export an image that is being used by xCAT. To export images, you must have the images defined in the I<osimage> table. All the columns in the I<osimage> and I<linuximage> tables will be exported. If kits are used in stateful or stateless images, I<kit>, I<kitcomponent> and I<kitrepo> tables will be exported. In addition, the following files will also be exported.
The B<imgexport> command will export an image that is being used by xCAT. To export images, you must have the images defined in the I<osimage> table. All the columns in the I<osimage> and I<linuximage> tables will be exported. If kits are used in stateful or stateless images, I<kit>, I<kitcomponent> and I<kitrepo> tables will be exported. In addition, the following files will also be exported.
For stateful:
x.pkglist
@ -45,24 +45,39 @@ For statelite:
where x is the name of the profile.
Any files specified by the -e flag will also be exported. If -p flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themsleves need to be manualy exported using -e flag.
Any files specified by the B<-e> flag will also be exported. If B<-p> flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themsleves need to be manualy exported using B<-e> flag.
For statelite, the litefile table settings for the image will also be exported. The litetree and statelite tables are not exported.
=head1 OPTIONS
=over 4
B<-e|--extra> I<srcfile:destdir> Pack up extra files. If I<destdir> is omitted, the destination directory will be the same as the source directory.
=item B<-e|--extra> I<srcfile:destdir>
B<-h|--help> Display usage message.
Pack up extra files. If I<destdir> is omitted, the destination directory will be the same as the source directory.
=item B<-h|--help>
Display usage message.
B<-p|--postscripts> I<node_name> Get the names of the postscripts and postbootscripts for the given node and pack them into the image.
=item B<-p|--postscripts> I<node_name>
B<-v|--verbose> Verbose output.
Get the names of the postscripts and postbootscripts for the given node and pack them into the image.
I<image_name> The name of the image. Use I<lsdef -t> osimage to find out all the image names.
=item B<-v|--verbose>
I<destination> The output bundle file name.
Verbose output.
=item I<image_name>
The name of the image. Use B<lsdef -t osimage> to find out all the image names.
=item I<destination>
The output bundle file name.
=back
=head1 RETURN VALUE

View File

@ -10,7 +10,7 @@ B<imgimport> I<bundle_file_name> [B<-p>|B<--postscripts> I<nodelist>] [B<-f>|B<-
=head1 DESCRIPTION
The imgimport command will import an image that has been exported by I<imgexport> from xCAT. This is the easiest way to transfer/backup/, change or share images created by xCAT whether they be stateless or stateful. The bundle file will be unpacked in the current working directory. The xCAT configuration such as I<osimage> and I<linuximage> tables will then be updated.
The B<imgimport> command will import an image that has been exported by B<imgexport> from xCAT. This is the easiest way to transfer, backup, change or share images created by xCAT whether they be stateless or stateful. The bundle file will be unpacked in the current working directory. The xCAT configuration such as I<osimage> and I<linuximage> tables will then be updated.
For stateful, the following files will be copied to the appropriate directories.
x.pkglist
@ -42,15 +42,15 @@ For statelite, the following files will be copied to the appropriate directories
where x is the profile name.
Any extra files, included by --extra flag in the imgexport command, will also be copied to the appropriate directories.
Any extra files, included by B<--extra> flag in the B<imgexport> command, will also be copied to the appropriate directories.
For statelite, the litefile table will be updated for the image. The litetree and statelite tables are not imported.
If -p flag is specified, the I<postscripts> table will be updated with the postscripts and the postbootscripts names from the image for the nodes given by this flag.
If B<-p> flag is specified, the I<postscripts> table will be updated with the postscripts and the postbootscripts names from the image for the nodes given by this flag.
If -f flag is not specified, all the files will be copied to the same directories as the source. If it is specified, the old profile name x will be changed to the new and the files will be copied to the appropriate directores for the new profiles. For example, I</opt/xcat/share/xcat/netboot/sles/x.pkglist> will be copied to I</install/custom/netboot/sles/compute_new.pkglist> and I</install/netboot/sles11/ppc64/x/kernel> will be copied to I</install/netboot/sles11/ppc64/compute_new/kernel>. This flag is commonly used when you want to copy the image on the same xCAT mn so you can make modification on the new one.
If B<-f> flag is not specified, all the files will be copied to the same directories as the source. If it is specified, the old profile name x will be changed to the new and the files will be copied to the appropriate directores for the new profiles. For example, I</opt/xcat/share/xcat/netboot/sles/x.pkglist> will be copied to I</install/custom/netboot/sles/compute_new.pkglist> and I</install/netboot/sles11/ppc64/x/kernel> will be copied to I</install/netboot/sles11/ppc64/compute_new/kernel>. This flag is commonly used when you want to copy the image on the same xCAT mn so you can make modification on the new one.
After this command, you can run the I<nodeset> command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node depolyment.
After this command, you can run the B<nodeset> command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node depolyment.
For stateful:
nodeset
@ -68,15 +68,25 @@ For statelite
=head1 OPTIONS
=over 4
B<-f|--profile> I<new_prof> Import the image with a new profile name.
=item B<-f|--profile> I<new_profile>
B<-h|--help> Display usage message.
Import the image with a new profile name.
B<-p|--postscripts> I<nodelist> Import the postscripts. The postscripts contained in the image will be set in the postscripts table for I<nodelist>.
=item B<-h|--help>
B<-v|--verbose> Verbose output.
Display usage message.
=item B<-p|--postscripts> I<nodelist>
Import the postscripts. The postscripts contained in the image will be set in the postscripts table for I<nodelist>.
=item B<-v|--verbose>
Verbose output.
=back
=head1 RETURN VALUE

View File

@ -28,13 +28,13 @@ B<lsvm> I<noderange>
=head1 DESCRIPTION
The lsvm command lists all partition profiles defined for the partitions specified in noderange. If noderange is a CEC, all the partitions associated with that CEC are displayed.
The B<lsvm> command lists all partition profiles defined for the partitions specified in I<noderange>. If I<noderange> is a CEC, all the partitions associated with that CEC are displayed.
=head2 For PPC (using Direct FSP Management):
For Power 775(use option I<--p775> to specify), lsvm lists all partition I/O slots information for the partitions specified in noderange. If noderange is a CEC, it gets the CEC's pump mode value, octant's memory interleaving value, the all the octants configure value, and all the I/O slots information.
For Power 775 (use option B<--p775> to specify), B<lsvm> lists all partition I/O slots information for the partitions specified in I<noderange>. If I<noderange> is a CEC, it gets the CEC's pump mode value, octant's memory interleaving value, the all the octants configure value, and all the I/O slots information.
For DFM-managed (short for Direct FSP Management mode) normal power machine, lsvm lists the processor, memory, physical I/O slots, hugepage and BSR info for the specified partitions or CEC.
For DFM-managed (short for Direct FSP Management mode) normal power machine, B<lsvm> lists the processor, memory, physical I/O slots, hugepage and BSR info for the specified partitions or CEC.
The pump mode value has the valid options:
1 - Node Pump Mode
@ -50,9 +50,9 @@ More information about this part, refer to the section Using the *vm commands to
=head2 For KVM and VMware
The virtual machines that defined in the hypervisor I<noderange> will be displayed. I<noderange> can only be hypervisor.
If I<noderange> is a hypervisor, virtual machines defined on that hypervisor will be displayed. If I<noderange> is a VM, details for that VM will be displayed.
Note: Only the virtual machine which is in power on state can be listed by lsvm command.
Note: Only the virtual machine which is in power on state can be listed by B<lsvm> command.
=head2 For zVM:
@ -67,7 +67,7 @@ Display usage message.
B<-v>
Command Version.
Command version.
B<-V>
@ -101,7 +101,7 @@ Output is similar to:
lpar3: name=lpar3,lpar_name=lpar3,lpar_id=4,lpar_env=aixlinux,all_resources=0,min_mem=512, desired_mem=2048, max_mem=3072,min_num_huge_pages=0,desired_num_huge_pages=0,max_num_huge_pages=0,proc_mode=shared, min_proc_units=0.5,desired_proc_units=0.5,max_proc_units=0.5,min_procs=1,desired_procs=1,max_procs=1, sharing_mode=uncap,uncap_weight=128,shared_proc_pool_id=0,shared_proc_pool_name=DefaultPool,io_slots=none, lpar_io_pool_ids=none,max_virtual_slots=10, "virtual_serial_adapters=1/server/1/any//any/1,0/server/1/any//any/1", virtual_scsi_adapters=2/client/1/p6vios/4/1,virtual_eth_adapters=3/0/1//0/1,hca_adapters=none,boot_mode=norm,conn_monitoring=0,auto_start=0,power_ctrl_lpar_ids=none,work_group_id=none,redundant_err_path_reporting=0, bsr_arrays=0,lhea_logical_ports=none,lhea_capabilities=none,lpar_proc_compat_mode=default,electronic_err_reporting=null
2.To list all IVM-managed partitions associated with CEC cec01, enter:
2. To list all IVM-managed partitions associated with CEC cec01, enter:
lsvm cec01
@ -164,7 +164,7 @@ Output is similar to:
OctantID=6,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
OctantID=7,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
6.To list the lparname of lpars, enter:
6. To list the lparname of lpars, enter:
lsvm cec1 -l --p775
@ -248,9 +248,9 @@ Output is similar to:
Bytes per BSR array: 4096
Available BSR array: 256
Note: The lines list in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class discription)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicate a physical I/O resource in normal power machine.
Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class discription)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine.
9.For DFM-managed partition on normal power machine, list out the detailed information:
9. For DFM-managed partition on normal power machine, list out the detailed information:
lsvm lpar1

View File

@ -46,7 +46,7 @@ sub process_request {
@ARGV = @{ $request->{arg} } if (defined $request->{arg});
my $argc = scalar @ARGV;
my $usage = "Usage: imgcapture <node> -t|--type diskless [-p | --profile <profile>] " .
my $usage = "Usage: imgcapture <node> -t|--type {diskless|sysclone} [-p | --profile <profile>] " .
"[-o|--osimage <osimage>] [-i <nodebootif>] [-n <nodenetdrivers>] " .
"[-d | --device <devicesToCapture>] [-c | --compress <compressionLevel>] [-V | --verbose] \n\n" .
"imgcapture <node> -t|--type sysclone -o|--osimage <osimage> [-V | --verbose] \n" .

View File

@ -24,6 +24,7 @@ my %needbladeinv;
use POSIX qw(ceil floor);
use Storable qw(nstore_fd retrieve_fd thaw freeze);
use Scalar::Util qw(looks_like_number);
use xCAT::Utils;
use xCAT::TableUtils;
use xCAT::IMMUtils;
@ -1857,15 +1858,27 @@ sub do_firmware_update {
if ($opt =~ /buffersize=/) {
my ($attribute, $buffer_value) = split(/=/, $opt);
if ($buffer_value) {
# buffersize option was passed in, reset the default
$buffer_size = $buffer_value;
# buffersize option was passed in, reset the default if valid
if (looks_like_number($buffer_value) and $buffer_value > 0) {
$buffer_size = $buffer_value;
}
else {
$exit_with_error_func->($sessdata->{node}, $callback,
"Invalid buffer size value $buffer_value");
}
}
}
if ($opt =~ /retry=/) {
my ($attribute, $retry_value) = split(/=/, $opt);
if ($retry_value) {
# retry option was passed in, reset the default
$retry = $retry_value;
if (defined $retry_value) {
# retry option was passed in, reset the default if valid
if (looks_like_number($retry_value) and $retry_value >= 0) {
$retry = $retry_value;
}
else {
$exit_with_error_func->($sessdata->{node}, $callback,
"Invalid retry value $retry_value");
}
}
}
}
@ -1897,7 +1910,9 @@ RETRY_UPGRADE:
# step 1 power off
$cmd = $pre_cmd . " chassis power off";
xCAT::SvrUtils::sendmsg("Preparing to upgrade firmware, powering chassis off...", $callback, $sessdata->{node}, %allerrornodes);
if ($verbose) {
xCAT::SvrUtils::sendmsg("Preparing to upgrade firmware, powering chassis off...", $callback, $sessdata->{node}, %allerrornodes);
}
$output = xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) {
$exit_with_error_func->($sessdata->{node}, $callback,
@ -1913,7 +1928,7 @@ RETRY_UPGRADE:
}
# check reset status
unless (check_bmc_status_with_ipmitool($pre_cmd, 5, 60, 1, $sessdata, $verbose)) {
unless (check_bmc_status_with_ipmitool($pre_cmd, 5, 60, 2, $sessdata, $verbose)) {
$exit_with_error_func->($sessdata->{node}, $callback,
"Timeout to check the bmc status");
}
@ -1932,23 +1947,30 @@ RETRY_UPGRADE:
my $rflash_log_file = xCAT::Utils->full_path($sessdata->{node}.".log", RFLASH_LOG_DIR);
$cmd .= " >".$rflash_log_file." 2>&1";
xCAT::SvrUtils::sendmsg([ 0,
if ($verbose) {
xCAT::SvrUtils::sendmsg([ 0,
"rflashing ... See the detail progress :\"tail -f $rflash_log_file\"" ],
$callback, $sessdata->{node});
$callback, $sessdata->{node});
}
$output = xCAT::Utils->runcmd($cmd, -1);
# if upgrade command failed and we exausted number of retries
# report an error, exit to the caller and leave node in powered off state
# otherwise report an error, power on the node and try upgrade again
if ($::RUNCMD_RC != 0) {
# Since "hpm update" command in step 4 above redirects standard out and error to a log file,
# nothing gets returned from execution of the command. Here if RC is not zero, we
# extract all lines containing "Error" from that log file and display them in the sendmsg below
my $get_error_cmd = "/usr/bin/grep Error $rflash_log_file";
$output = xCAT::Utils->runcmd($get_error_cmd, 0);
if ($retry == 0) {
# No more retries left, report and error and exit
# No more retries left, report an error and exit
$exit_with_error_func->($sessdata->{node}, $callback,
"Running ipmitool command $cmd failed: $output");
"Running ipmitool command $cmd failed with rc=$::RUNCMD_RC and the following error messages:\n$output\nSee the $rflash_log_file for details.");
}
else {
# Error upgrading, set a flag to attempt a retry
xCAT::SvrUtils::sendmsg("Running ipmitool command $cmd failed: $output", $callback, $sessdata->{node}, %allerrornodes);
xCAT::SvrUtils::sendmsg("Running attempt $retry of ipmitool command $cmd failed with rc=$::RUNCMD_RC and the following error messages:\n$output\nSee the $rflash_log_file for details.", $callback, $sessdata->{node}, %allerrornodes);
$failed_upgrade = 1;
}
@ -1956,7 +1978,7 @@ RETRY_UPGRADE:
# step 5 power on
# check reset status
unless (check_bmc_status_with_ipmitool($pre_cmd, 5, 60, 15, $sessdata, $verbose)) {
unless (check_bmc_status_with_ipmitool($pre_cmd, 5, 60, 10, $sessdata, $verbose)) {
$exit_with_error_func->($sessdata->{node}, $callback,
"Timeout to check the bmc status");
}
@ -1965,7 +1987,9 @@ RETRY_UPGRADE:
xCAT::SvrUtils::sendmsg("Firmware update failed, powering chassis on for a retry. This can take several minutes. $retry retries left ...", $callback, $sessdata->{node}, %allerrornodes);
}
else {
xCAT::SvrUtils::sendmsg("Firmware updated, powering chassis on to populate FRU information...", $callback, $sessdata->{node}, %allerrornodes);
if ($verbose) {
xCAT::SvrUtils::sendmsg("Firmware updated, powering chassis on to populate FRU information...", $callback, $sessdata->{node}, %allerrornodes);
}
}
$cmd = $pre_cmd . " chassis power on";

View File

@ -26,6 +26,7 @@ use IO::Select;
use xCAT::TableUtils;
use xCAT::ServiceNodeUtils;
use strict;
use feature "switch"; # For given-when block
#use warnings;
my $use_xhrm = 0; #xCAT Hypervisor Resource Manager, to satisfy networking and storage prerequisites, default to not using it for the moment
@ -81,7 +82,7 @@ sub handled_commands {
#rvitals => 'nodehm:mgt',
#rinv => 'nodehm:mgt',
getrvidparms => 'nodehm:mgt',
lsvm => 'nodehm:mgt=ipmi',
lsvm => ['nodehm:mgt=ipmi', 'nodehm:mgt=kvm'], #allow both hypervisor and VMs as params
rbeacon => 'nodehm:mgt',
revacuate => 'hypervisor:type',
vmstatenotify => 'hypervisor:type',
@ -3512,11 +3513,84 @@ sub rscan {
}
sub lsvm {
my $node = shift;
my $host = shift;
my $vm = shift;
my @doms = $hypconn->list_domains();
my @vms;
foreach (@doms) {
push @vms, $_->get_name();
if ($host ne $vm) {
# Processing lsvm for a VM, display details about that VM
foreach (@doms) {
if ($_->get_name() eq $vm) {
push @vms, "Id:" . $_->get_id();
push @vms, "Host:" . $host;
push @vms, "OS:" . $_->get_os_type();
my $domain_info = $_->get_info();
if (exists $domain_info->{"memory"}) {
push @vms, "Memory:" . $domain_info->{"memory"};
}
if (exists $domain_info->{"nrVirtCpu"}) {
push @vms, "CPU: " . $domain_info->{"nrVirtCpu"};
}
if (exists $domain_info->{"state"}) {
my $state = $domain_info->{"state"};
my $state_string;
given($state) {
when ($state == &Sys::Virt::Domain::STATE_NOSTATE)
{$state_string = "The domain is active, but is not running / blocked (eg idle)";}
when ($state == &Sys::Virt::Domain::STATE_RUNNING)
{$state_string = "The domain is active and running";}
when ($state == &Sys::Virt::Domain::STATE_BLOCKED)
{$state_string = "The domain is active, but execution is blocked";}
when ($state == &Sys::Virt::Domain::STATE_PAUSED)
{$state_string = "The domain is active, but execution has been paused";}
when ($state == &Sys::Virt::Domain::STATE_SHUTDOWN)
{$state_string = "The domain is active, but in the shutdown phase";}
when ($state == &Sys::Virt::Domain::STATE_SHUTOFF)
{$state_string = "The domain is inactive, and shut down";}
when ($state == &Sys::Virt::Domain::STATE_CRUSHED)
{$state_string = "The domain is inactive, and crashed";}
when ($state == &Sys::Virt::Domain::STATE_PMSUSPENDED)
{$state_string = "The domain is active, but in power management suspend state";}
default {$state_string = "Unknown"};
}
push @vms, "State :" . $domain_info->{"state"} . " ($state_string)";
}
# The following block of code copied from rscan command processng for disks
my $currxml = $_->get_xml_description();
if ($currxml) {
my $domain = $parser->parse_string($currxml);
my @vmstoragediskobjs = $domain->findnodes("/domain/devices/disk");
foreach my $vmstoragediskobj (@vmstoragediskobjs) {
my ($vmstorage_file_obj, $vmstorage_block_obj);
if (($vmstoragediskobj->getAttribute("device") eq "disk") and ($vmstoragediskobj->getAttribute("type") eq "file")) {
my @vmstorageobj = $vmstoragediskobj->findnodes("./source");
if (@vmstorageobj) {
$vmstorage_file_obj = $vmstorageobj[0]->getAttribute("file");
push @vms, "Disk file:" . $vmstorage_file_obj;
}
}
if (($vmstoragediskobj->getAttribute("device") eq "disk") and ($vmstoragediskobj->getAttribute("type") eq "block")) {
my @vmstorageobj = $vmstoragediskobj->findnodes("./source");
if (@vmstorageobj) {
$vmstorage_block_obj = $vmstorageobj[0]->getAttribute("dev");
push @vms, "Disk object:" . $vmstorage_block_obj;
}
}
}
}
}
}
}
else {
# Processing lsvm for hypervisor, display a list of VMs on that hypervisor
foreach (@doms) {
push @vms, $_->get_name();
}
}
# Check if we were able to get any data
unless (@vms) {
push @vms, "Could not get any information about specified object";
}
return (0, @vms);
}
@ -3547,7 +3621,7 @@ sub guestcmd {
} elsif ($command eq "getcons") {
return getcons($node, @args);
} elsif ($command eq "lsvm") {
return lsvm($node, @args);
return lsvm($hyp, $node, @args);
} elsif ($command eq "rscan") {
return rscan($node, @args);
}
@ -3783,7 +3857,7 @@ sub process_request {
if ($::XCATSITEVALS{usexhrm}) { $use_xhrm = 1; }
$vmtab = xCAT::Table->new("vm");
$confdata = {};
unless ($command eq 'lsvm' or $command eq 'rscan') {
unless ($command eq 'rscan') {
xCAT::VMCommon::grab_table_data($noderange, $confdata, $callback);
# Add debug info for issue 1958, the rmvm issue
my $test_file_fd;
@ -3824,7 +3898,8 @@ sub process_request {
my $inputs = new IO::Select;
my $sub_fds = new IO::Select;
%hyphash = ();
if ($command eq 'lsvm' or $command eq 'rscan') { #command intended for hypervisors, not guests
if ($command eq 'rscan') { #command intended for hypervisors, not guests
foreach (@$noderange) { $hyphash{$_}->{nodes}->{$_} = 1; }
} else {
foreach (keys %{ $confdata->{vm} }) {
@ -3868,6 +3943,12 @@ sub process_request {
# foreach (keys %orphans) {
# $hyphash{'!@!XCATDUMMYHYPERVISOR!@!'}->{nodes}->{$_}=1;
# }
} elsif ($command eq "lsvm") {
# Special processing for lsvm command, which takes vm name or hypervisor name
unless (%hyphash) {
# if hyperhash has not been set already, we are processing vms, set it here
foreach (@$noderange) { $hyphash{$_}->{nodes}->{$_} = 1; }
}
} else {
$callback->({ error => "Can't find " . join(",", keys %orphans), errorcode => [1] });
return;
@ -4000,7 +4081,6 @@ sub dohyp {
$offlinehyps{$hyp} = 1;
}
eval { #Contain Sys::Virt bugs that make $@ useless
if ($hyp eq '!@!XCATDUMMYHYPERVISOR!@!') { #Fake connection for commands that have a fake hypervisor key
$hypconn = 1;
@ -4031,7 +4111,7 @@ sub dohyp {
return 1, "General error establishing libvirt communication";
}
}
if (($command eq 'mkvm' or $command eq 'chvm' or $command eq 'rpower') and $hypconn) {
if (($command =~ /^mkvm$|^chvm$|^rpower$|^lsvm$/) and $hypconn) {
my $nodeinfo = $hypconn->get_node_info();
if (exists($nodeinfo->{model})) {
$confdata->{$hyp}->{cpumodel} = $nodeinfo->{model};

View File

@ -15,17 +15,19 @@ use lib "$::XCATROOT/lib/perl";
use strict;
use warnings "all";
use JSON;
use HTTP::Async;
use HTTP::Cookies;
use File::Basename;
use Data::Dumper;
use Getopt::Long;
use xCAT::OPENBMC;
use xCAT::Utils;
use xCAT::Table;
use xCAT::Usage;
use xCAT::SvrUtils;
use File::Basename;
use Data::Dumper;
use Getopt::Long;
use JSON;
use xCAT::GlobalDef;
use xCAT_monitoring::monitorctrl;
sub unsupported {
my $callback = shift;
@ -158,6 +160,21 @@ my %status_info = (
RSETBOOT_STATUS_RESPONSE => {
process => \&rsetboot_response,
},
REVENTLOG_REQUEST => {
method => "GET",
init_url => "$openbmc_project_url/logging/enumerate",
},
REVENTLOG_RESPONSE => {
process => \&reventlog_response,
},
REVENTLOG_CLEAR_REQUEST => {
method => "POST",
init_url => "$openbmc_url/records/events/action/clear",
data => "",
},
REVENTLOG_CLEAR_RESPONSE => {
process => \&reventlog_response,
},
);
$::RESPONSE_OK = "200 OK";
@ -279,15 +296,17 @@ sub process_request {
parse_node_info($noderange);
parse_command_status($command);
$cookie_jar = HTTP::Cookies->new({});
$async = HTTP::Async->new(
cookie_jar => $cookie_jar,
timeout => 10,
max_request_time => 60,
ssl_options => {
SSL_verify_mode => 0,
},
);
if ($request->{command}->[0] ne "getopenbmccons") {
$cookie_jar = HTTP::Cookies->new({});
$async = HTTP::Async->new(
cookie_jar => $cookie_jar,
timeout => 10,
max_request_time => 60,
ssl_options => {
SSL_verify_mode => 0,
},
);
}
my $bmcip;
my $login_url;
@ -298,13 +317,17 @@ sub process_request {
foreach my $node (keys %node_info) {
$bmcip = $node_info{$node}{bmc};
$login_url = "$http_protocol://$bmcip/login";
$content = '{"data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }';
$handle_id = xCAT::OPENBMC->new($async, $login_url, $content);
$handle_id_node{$handle_id} = $node;
$node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} };
print "$node: DEBUG POST $login_url -d $content\n";
push @donargs, [ $node,$bmcip,$node_info{$node}{username}, $node_info{$node}{password}];
if ($request->{command}->[0] eq "getopenbmccons") {
push @donargs, [ $node,$bmcip,$node_info{$node}{username}, $node_info{$node}{password}];
} else {
$login_url = "$http_protocol://$bmcip/login";
$content = '{"data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }';
$handle_id = xCAT::OPENBMC->new($async, $login_url, $content);
$handle_id_node{$handle_id} = $node;
$node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} };
print "$node: DEBUG POST $login_url -d $content\n";
}
}
#process rcons
@ -340,7 +363,7 @@ sub parse_args {
my $extrargs = shift;
my $check = undef;
if (scalar(@ARGV) > 1 and $command ne "rsetboot") {
if (scalar(@ARGV) > 1 and $command ne "rsetboot" and $command ne "reventlog") {
return ([ 1, "Only one option is supported at the same time" ]);
}
@ -380,6 +403,16 @@ sub parse_args {
unless ($subcommand =~ /^net$|^hd$|^cd$|^def$|^default$|^stat$/) {
return ([ 1, "Unsupported command: $command $subcommand" ]);
}
} elsif ($command eq "reventlog") {
#
# disable function until fully tested
#
$subcommand = "all" if (!defined($ARGV[0]));
$check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; }
unless ($subcommand =~ /^\d$|^\d+$|^all$|^clear$/) {
return ([ 1, "Unsupported command: $command $subcommand" ]);
}
} else {
return ([ 1, "Command is not supported." ]);
}
@ -471,6 +504,30 @@ sub parse_command_status {
exit;
}
if ($command eq "reventlog") {
my $option_s = 0;
unless (GetOptions("s" => \$option_s,)) {
xCAT::SvrUtils::sendmsg([ 1, "Error parsing arguments" ], $callback);
exit 1;
}
if (defined($ARGV[0])) {
$subcommand = $ARGV[0];
} else {
$subcommand = "all";
}
if ($subcommand eq "clear") {
$next_status{LOGIN_RESPONSE} = "REVENTLOG_CLEAR_REQUEST";
$next_status{REVENTLOG_CLEAR_REQUEST} = "REVENTLOG_CLEAR_RESPONSE";
} else {
$next_status{LOGIN_RESPONSE} = "REVENTLOG_REQUEST";
$next_status{REVENTLOG_REQUEST} = "REVENTLOG_RESPONSE";
$status_info{REVENTLOG_RESPONSE}{argv} = "$subcommand";
$status_info{REVENTLOG_RESPONSE}{argv} .= ",s" if ($option_s);
}
}
print Dumper(\%next_status) . "\n";
}
@ -673,27 +730,33 @@ sub login_response {
sub rpower_response {
my $node = shift;
my $response = shift;
my %new_status = ();
my $response_info = decode_json $response->content;
if ($node_info{$node}{cur_status} eq "RPOWER_ON_RESPONSE") {
if ($response_info->{'message'} eq $::RESPONSE_OK) {
xCAT::SvrUtils::sendmsg("on", $callback, $node);
$new_status{$::STATUS_POWERING_ON} = [$node];
}
}
if ($node_info{$node}{cur_status} eq "RPOWER_OFF_RESPONSE") {
if ($response_info->{'message'} eq $::RESPONSE_OK) {
xCAT::SvrUtils::sendmsg("off", $callback, $node);
$new_status{$::STATUS_POWERING_OFF} = [$node];
}
}
if ($node_info{$node}{cur_status} eq "RPOWER_RESET_RESPONSE") {
if ($response_info->{'message'} eq $::RESPONSE_OK) {
xCAT::SvrUtils::sendmsg("reset", $callback, $node);
$new_status{$::STATUS_POWERING_ON} = [$node];
}
}
xCAT_monitoring::monitorctrl::setNodeStatusAttributes(\%new_status, 1) if (%new_status);
if ($node_info{$node}{cur_status} eq "RPOWER_STATUS_RESPONSE" and !$next_status{ $node_info{$node}{cur_status} }) {
if ($response_info->{'data'}->{CurrentHostState} =~ /Off$/) {
xCAT::SvrUtils::sendmsg("off", $callback, $node);
@ -887,4 +950,63 @@ sub rsetboot_response {
return;
}
#-------------------------------------------------------
=head3 reventlog_response
Deal with response of reventlog command
Input:
$node: nodename of current response
$response: Async return response
=cut
#-------------------------------------------------------
sub reventlog_response {
my $node = shift;
my $response = shift;
my $response_info = decode_json $response->content;
if ($node_info{$node}{cur_status} eq "REVENTLOG_CLEAR_REQUEST") {
if ($response_info->{'message'} eq $::RESPONSE_OK) {
xCAT::SvrUtils::sendmsg("clear", $callback, $node);
}
} else {
my ($entry_string, $option_s) = split(",", $status_info{REVENTLOG_RESPONSE}{argv});
my $content_info;
my %output_s = () if ($option_s);
my $entry_num = 0;
$entry_string = "all" if ($entry_string eq "0");
$entry_num = 0 + $entry_string if ($entry_string ne "all");
foreach my $key_url (keys %{$response_info->{data}}) {
my %content = %{ ${ $response_info->{data} }{$key_url} };
my $id_num = 0 + $content{Id} if ($content{Id});
if (($entry_string eq "all" or ($id_num and ($entry_num ge $id_num))) and $content{Message}) {
my $content_info = $content{Timestamp} . " " . $content{Message};
if ($option_s) {
$output_s{$id_num} = $content_info;
$entry_num = $id_num if ($entry_num < $id_num);
} else {
xCAT::SvrUtils::sendmsg("$content_info", $callback, $node);
}
}
}
if (%output_s) {
for (my $key = $entry_num; $key >= 1; $key--) {
xCAT::SvrUtils::sendmsg("$output_s{$key}", $callback, $node) if ($output_s{$key});
}
}
}
if ($next_status{ $node_info{$node}{cur_status} }) {
$node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} };
gen_send_request($node);
} else {
$wait_node_num--;
}
}
1;

View File

@ -141,8 +141,22 @@ if [ -z "$install_disk" ]; then
disk_wwn=$(echo $output_for_wwn | $utolcmd)
output_for_path=$(IFS= ;echo $disk_info | grep DEVPATH | cut -d "=" -f2)
disk_path=$(echo $output_for_path | $utolcmd)
disk_driver=$(udevadm info --attribute-walk --name=$disk | grep DRIVERS| grep -v '""'| grep -v '"sd"'|
# Work around the issue Pegas running on Power9 installation hang in anaconda
# with "TypeError: argument of type 'NoneType' is not iterable",
# after running of "udevadm info --attribute-walk --name=/dev/sda" in %pre section of kickstart
exec 42>&1
anaconda_version=$(anaconda --version 2>&1 >&42)
exec 42>&-
cpu_model=$(awk '/model/ { print $NF }' /proc/cpuinfo)
p9_bool=$(grep POWER9 /proc/cpuinfo|head -n 1|awk '{print $3}')
if [ "$anaconda_version" == "anaconda 21.48.22.93-1" -a \
"$cpu_model" == "0000000000000000" -a "$p9_bool" == "POWER9" ]; then
disk_driver=""
else
disk_driver=$(udevadm info --attribute-walk --name=$disk | grep DRIVERS| grep -v '""'| grep -v '"sd"'|
\head -n 1| sed -e 's/[^"]*"//' -e 's/"//' | $utolcmd)
fi
echo "[get_install_disk]The disk $disk information: "
echo "[get_install_disk] disk_wwn=$disk_wwn"

View File

@ -243,8 +243,8 @@ check:rc==0
cmd:rpower $$DOCKERCN start
check:rc==0
cmd:rmdocker $$DOCKERCN
chec:rc!=0
check:output=~Stop the container before attempting removal or use -f
check:rc!=0
check:output=~Stop the container
cmd:rmdocker $$DOCKERCN -f
check:rc==0
check:output=~$$DOCKERCN: success

View File

@ -36,6 +36,8 @@ check:rc==0
cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi;
cmd:echo "/test.synclist -> /test.synclist" > /test.synclist;chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/test.synclist
check:rc==0
cmd:nodeset $$CN osimage= __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute
check:rc==0
cmd:updatenode $$CN -f
check:rc==0
cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute

View File

@ -37,6 +37,8 @@ check:rc==0
cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi;
cmd:echo "/test.synclist -> /test.synclist" > /test.synclist;chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/test.synclist
check:rc==0
cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute
check:rc==0
cmd:updatenode $$CN -f
check:rc==0
cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute

View File

@ -42,6 +42,8 @@ check:rc==0
cmd:if cat /etc/*release |grep SUSE >/dev/null;then xdsh $$SN 'service nfsserver restart'; elif cat /etc/*release |grep "Red Hat" >/dev/null;then xdsh $$SN 'service nfs restart'; fi
check:rc==0
cmd:xdsh $$SN 'showmount -e'
cmd:chtab node=$$CN statelite.statemnt="$$SN:/nodedata"
check:rc==0
@ -58,6 +60,12 @@ check:rc==0
cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak;fi
check:rc==0
cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute
check:rc==0
cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute rootfstype=nfs
check:rc==0
cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute
check:rc==0
cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute

View File

@ -138,26 +138,36 @@ cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | gr
check:rc==0
cmd:makehosts s01
check:rc==0
cmd:sleep 20
cmd:cat /etc/hosts
cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 =~ "70.2.0.254 s01" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi
check:rc==0
cmd:makehosts service
check:rc==0
cmd:sleep 20
cmd:cat /etc/hosts
cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 =~ "70.2.0.254 s01" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi
check:rc==0
cmd:makehosts -d s01
check:rc==0
cmd:sleep 20
cmd:cat /etc/hosts
cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 = "" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi
check:rc==0
cmd:makehosts
check:rc==0
cmd:makehosts -d service
check:rc==0
cmd:sleep 20
cmd:cat /etc/hosts
cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 = "" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi
check:rc==0
cmd:makehosts
check:rc==0
cmd:makehosts -d s01r1b01
check:rc==0
cmd:sleep 20
cmd:cat /etc/hosts
cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 =~ "70.2.0.254 s01" ]] && [[ $rc2 = "" ]];then exit 0;else exit 1;fi
check:rc==0
cmd:if [ -e /tmp/s01.standa ]; then rmdef s01; cat /tmp/s01.standa | mkdef -z; rm -rf /tmp/s01.standa; else rmdef s01;fi

View File

@ -1,5 +1,6 @@
start:rsetboot_hd_statcheck
description:set the boot device from hd
Attribute: $$CN-The operation object of rsetboot command.
cmd:rsetboot $$CN hd
check:rc==0
check:output=~Hard Drive
@ -10,6 +11,7 @@ end
start:rsetboot_net_statcheck
description:set the boot device from net
Attribute: $$CN-The operation object of rsetboot command.
cmd:rsetboot $$CN net
check:rc==0
check:output=~Network
@ -20,6 +22,7 @@ end
start:rsetboot_cd_statcheck
description:set the boot device from CD/DVD
Attribute: $$CN-The operation object of rsetboot command.
cmd:rsetboot $$CN cd
check:rc==0
check:output=~CD/DVD
@ -30,6 +33,7 @@ end
start:rsetboot_default_statcheck
description:set the boot device default
Attribute: $$CN-The operation object of rsetboot command.
cmd:rsetboot $$CN default
check:rc==0
check:output=~boot override inactive
@ -38,3 +42,57 @@ check:rc==0
check:output=~$$CN: boot override inactive
end
start:rsetboot_h
description:get rsetboot help information
cmd:rsetboot -h
check:rc==0
check:output=~Usage: rsetboot
end
start:rsetboot_help
description:get rsetboot help information using rsetboot help
cmd:rsetboot -help
check:rc==0
check:output=~Usage: rsetboot
end
start:rsetboot_v
desription:get rsetboot version
cmd:rsetboot -v
check:rc==0
check:output=~Version
end
start:rsetboot_node_invalidnode
desription:rsetboot using invalidenode
cmd:rsetboot testnode boot
check:rc!=0
check:output=~Error: Invalid nodes
end
start:rsetboot_noderange_net
description:rsetboot noderange net
Attribute: $$CN,$$BC-The operation object of rsetboot command.
cmd:rsetboot $$CN,$$BC net
check:output=~$$CN: Network
cmd:rsetboot $$CN,$$BC stat
check:output=~$$CN: Network
check:output=~$$BC: Network
end
start:rsetboot_node_invalidaction
description:rsetboot node using invalidaction
Attribute: $$CN-The operation object of rsetboot command.
cmd:rsetboot $$CN dsdf
check:rc!=0
check:output=~Error: unsupported command
end
start:rsetboot_group_net
description:rsetboot group node
Attribute: $$CN-The operation object of rsetboot command.
cmd:rsetboot __GETNODEATTR($$CN,groups)__ net
check:output=~$$CN: Network
cmd:rsetboot __GETNODEATTR($$CN,groups)__ stat
check:output=~$$CN: Network
end