From 6bb5ba27cf0afb33e32e98a30db5ea6868694ba2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 16 Nov 2017 15:03:05 -0500 Subject: [PATCH 01/30] Add disablenodesetwarning to man page --- perl-xCAT/xCAT/Schema.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index f01edfd98..cb63e1c57 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1143,6 +1143,7 @@ passed as argument rather than by table value', " defserialflow: The default serial flow - currently only used by the mknb command.\n\n" . " defserialport: The default serial port - currently only used by mknb.\n\n" . " defserialspeed: The default serial speed - currently only used by mknb.\n\n" . +" disablenodesetwarning: Allow the legacy xCAT non-osimage style nodeset to execute.\n\n" . " genmacprefix: When generating mac addresses automatically, use this manufacturing\n" . " prefix (e.g. 00:11:aa)\n\n" . " genpasswords: Automatically generate random passwords for BMCs when configuring\n" . From c144069d774be7bd2634b85fa6ef71cd92423f11 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 11 Jan 2018 18:55:20 +0800 Subject: [PATCH 02/30] Add script to convert xCAT-genesis-base rpm package to deb package --- .../debuild-xcat-genesis-base | 39 +++++++++++++++++++ .../xCAT-genesis-builder.spec | 1 + 2 files changed, 40 insertions(+) create mode 100755 xCAT-genesis-builder/debuild-xcat-genesis-base diff --git a/xCAT-genesis-builder/debuild-xcat-genesis-base b/xCAT-genesis-builder/debuild-xcat-genesis-base new file mode 100755 index 000000000..1b952adc3 --- /dev/null +++ b/xCAT-genesis-builder/debuild-xcat-genesis-base @@ -0,0 +1,39 @@ +#!/bin/bash + +# xCAT-genesis-base-x86_64-2.13.10-snap201801090246.noarch.rpm +RPM_PACKAGE="$1" + +[ -n "${RPM_PACKAGE}" ] || exit 1 +[ -f "${RPM_PACKAGE}" ] || exit 1 + +EXTRACT_DIR="${RPM_PACKAGE##*/}" +EXTRACT_DIR="${EXTRACT_DIR%%-snap*}" + +rm -rf "${EXTRACT_DIR}" +rm -rf "${EXTRACT_DIR}.orig" +alien -d -g -c -k "${RPM_PACKAGE}" || exit 1 + +PACKAGE_ARCH="${EXTRACT_DIR%-*}" +PACKAGE_ARCH="${PACKAGE_ARCH##*-}" + +if [[ ${EXTRACT_DIR} =~ -x86_64- ]] +then + rm -rf "${EXTRACT_DIR//x86_64/amd64}" + mv "${EXTRACT_DIR}" "${EXTRACT_DIR//x86_64/amd64}" + EXTRACT_DIR="${EXTRACT_DIR//x86_64/amd64}" + + sed -i -e 's/x86-64/amd64/g' "${EXTRACT_DIR}/debian/control" + sed -i -e 's/x86-64/amd64/g' "${EXTRACT_DIR}/debian/changelog" +fi + +cat >"${EXTRACT_DIR}/debian/preinst" <<-EOF +#!/bin/bash + +rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/bin +rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/sbin +rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/lib +rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/lib64 +rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/var/run +EOF + +( cd "${EXTRACT_DIR}" && debian/rules binary ) diff --git a/xCAT-genesis-builder/xCAT-genesis-builder.spec b/xCAT-genesis-builder/xCAT-genesis-builder.spec index e1704f8fc..8321f99e6 100644 --- a/xCAT-genesis-builder/xCAT-genesis-builder.spec +++ b/xCAT-genesis-builder/xCAT-genesis-builder.spec @@ -34,6 +34,7 @@ mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/genesis/builder cd $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/genesis/builder tar jxvf %{SOURCE1} chmod +x $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/genesis/builder/buildrpm +chmod +x $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/genesis/builder/debuild-xcat-genesis-base cd - From 63a3efe8bb87799c3ffb6804eb5bc2f3efbb4c2b Mon Sep 17 00:00:00 2001 From: Samveen Gulati Date: Wed, 10 Jan 2018 09:23:43 +0000 Subject: [PATCH 03/30] move `/*bin` to `/usr/` to fix path conflict of genesis `base` and `scripts` RH7/Centos7 and recent versions of fedora relocate `/*bin/*` into `/usr/*bin/`. This causes conflicts for upgrades against xCAT-genesis-scripts-* packages which expect the `/bin` a to be a directory while `xCAT-genesis-base-*` packages provide a link. Relocating all files into `/usr` fixes that conflict and allows a clean upgrade from all old versions. --- xCAT-genesis-scripts/debian/rules | 4 +- .../{ => usr}/bin/allowcred.awk | 0 xCAT-genesis-scripts/{ => usr}/bin/bmcsetup | 0 xCAT-genesis-scripts/{ => usr}/bin/configraid | 0 .../{ => usr}/bin/diskdiscover | 0 .../{ => usr}/bin/dodiscovery | 0 xCAT-genesis-scripts/{ => usr}/bin/dosysclone | 0 xCAT-genesis-scripts/{ => usr}/bin/doxcat | 0 xCAT-genesis-scripts/{ => usr}/bin/getadapter | 0 xCAT-genesis-scripts/{ => usr}/bin/getcert | 0 xCAT-genesis-scripts/{ => usr}/bin/getdestiny | 0 xCAT-genesis-scripts/{ => usr}/bin/getipmi | 0 xCAT-genesis-scripts/{ => usr}/bin/ifup | 0 .../{ => usr}/bin/minixcatd.awk | 0 .../{ => usr}/bin/nextdestiny | 0 .../{ => usr}/bin/pseries_platform | 0 xCAT-genesis-scripts/{ => usr}/bin/raidcmd | 0 xCAT-genesis-scripts/{ => usr}/bin/raidutils | 0 .../{ => usr}/bin/remoteimmsetup | 0 xCAT-genesis-scripts/{ => usr}/bin/restart | 0 xCAT-genesis-scripts/{ => usr}/bin/udpcat.awk | 0 .../{ => usr}/bin/update_flash | 0 .../{ => usr}/bin/update_flash_nv | 0 .../{ => usr}/bin/updateflag.awk | 0 .../{ => usr}/sbin/loadmlxeth | 0 .../{ => usr}/sbin/setupimmnic | 0 .../xCAT-genesis-scripts.spec | 50 +++++++++---------- 27 files changed, 27 insertions(+), 27 deletions(-) rename xCAT-genesis-scripts/{ => usr}/bin/allowcred.awk (100%) rename xCAT-genesis-scripts/{ => usr}/bin/bmcsetup (100%) rename xCAT-genesis-scripts/{ => usr}/bin/configraid (100%) rename xCAT-genesis-scripts/{ => usr}/bin/diskdiscover (100%) rename xCAT-genesis-scripts/{ => usr}/bin/dodiscovery (100%) rename xCAT-genesis-scripts/{ => usr}/bin/dosysclone (100%) rename xCAT-genesis-scripts/{ => usr}/bin/doxcat (100%) rename xCAT-genesis-scripts/{ => usr}/bin/getadapter (100%) rename xCAT-genesis-scripts/{ => usr}/bin/getcert (100%) rename xCAT-genesis-scripts/{ => usr}/bin/getdestiny (100%) rename xCAT-genesis-scripts/{ => usr}/bin/getipmi (100%) rename xCAT-genesis-scripts/{ => usr}/bin/ifup (100%) rename xCAT-genesis-scripts/{ => usr}/bin/minixcatd.awk (100%) rename xCAT-genesis-scripts/{ => usr}/bin/nextdestiny (100%) rename xCAT-genesis-scripts/{ => usr}/bin/pseries_platform (100%) rename xCAT-genesis-scripts/{ => usr}/bin/raidcmd (100%) rename xCAT-genesis-scripts/{ => usr}/bin/raidutils (100%) rename xCAT-genesis-scripts/{ => usr}/bin/remoteimmsetup (100%) rename xCAT-genesis-scripts/{ => usr}/bin/restart (100%) rename xCAT-genesis-scripts/{ => usr}/bin/udpcat.awk (100%) rename xCAT-genesis-scripts/{ => usr}/bin/update_flash (100%) rename xCAT-genesis-scripts/{ => usr}/bin/update_flash_nv (100%) rename xCAT-genesis-scripts/{ => usr}/bin/updateflag.awk (100%) rename xCAT-genesis-scripts/{ => usr}/sbin/loadmlxeth (100%) rename xCAT-genesis-scripts/{ => usr}/sbin/setupimmnic (100%) diff --git a/xCAT-genesis-scripts/debian/rules b/xCAT-genesis-scripts/debian/rules index adff007b4..6da840833 100755 --- a/xCAT-genesis-scripts/debian/rules +++ b/xCAT-genesis-scripts/debian/rules @@ -33,8 +33,8 @@ install: dh_installdirs $(installdir) dh_install -X".svn" dh_install ./etc/ $(installtodir) - dh_install ./bin/ $(installtodir) - dh_install ./sbin/ $(installtodir) + dh_install ./usr/bin/ $(installtodir) + dh_install ./usr/sbin/ $(installtodir) dh_compress dh_installdeb dh_gencontrol diff --git a/xCAT-genesis-scripts/bin/allowcred.awk b/xCAT-genesis-scripts/usr/bin/allowcred.awk similarity index 100% rename from xCAT-genesis-scripts/bin/allowcred.awk rename to xCAT-genesis-scripts/usr/bin/allowcred.awk diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/usr/bin/bmcsetup similarity index 100% rename from xCAT-genesis-scripts/bin/bmcsetup rename to xCAT-genesis-scripts/usr/bin/bmcsetup diff --git a/xCAT-genesis-scripts/bin/configraid b/xCAT-genesis-scripts/usr/bin/configraid similarity index 100% rename from xCAT-genesis-scripts/bin/configraid rename to xCAT-genesis-scripts/usr/bin/configraid diff --git a/xCAT-genesis-scripts/bin/diskdiscover b/xCAT-genesis-scripts/usr/bin/diskdiscover similarity index 100% rename from xCAT-genesis-scripts/bin/diskdiscover rename to xCAT-genesis-scripts/usr/bin/diskdiscover diff --git a/xCAT-genesis-scripts/bin/dodiscovery b/xCAT-genesis-scripts/usr/bin/dodiscovery similarity index 100% rename from xCAT-genesis-scripts/bin/dodiscovery rename to xCAT-genesis-scripts/usr/bin/dodiscovery diff --git a/xCAT-genesis-scripts/bin/dosysclone b/xCAT-genesis-scripts/usr/bin/dosysclone similarity index 100% rename from xCAT-genesis-scripts/bin/dosysclone rename to xCAT-genesis-scripts/usr/bin/dosysclone diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/usr/bin/doxcat similarity index 100% rename from xCAT-genesis-scripts/bin/doxcat rename to xCAT-genesis-scripts/usr/bin/doxcat diff --git a/xCAT-genesis-scripts/bin/getadapter b/xCAT-genesis-scripts/usr/bin/getadapter similarity index 100% rename from xCAT-genesis-scripts/bin/getadapter rename to xCAT-genesis-scripts/usr/bin/getadapter diff --git a/xCAT-genesis-scripts/bin/getcert b/xCAT-genesis-scripts/usr/bin/getcert similarity index 100% rename from xCAT-genesis-scripts/bin/getcert rename to xCAT-genesis-scripts/usr/bin/getcert diff --git a/xCAT-genesis-scripts/bin/getdestiny b/xCAT-genesis-scripts/usr/bin/getdestiny similarity index 100% rename from xCAT-genesis-scripts/bin/getdestiny rename to xCAT-genesis-scripts/usr/bin/getdestiny diff --git a/xCAT-genesis-scripts/bin/getipmi b/xCAT-genesis-scripts/usr/bin/getipmi similarity index 100% rename from xCAT-genesis-scripts/bin/getipmi rename to xCAT-genesis-scripts/usr/bin/getipmi diff --git a/xCAT-genesis-scripts/bin/ifup b/xCAT-genesis-scripts/usr/bin/ifup similarity index 100% rename from xCAT-genesis-scripts/bin/ifup rename to xCAT-genesis-scripts/usr/bin/ifup diff --git a/xCAT-genesis-scripts/bin/minixcatd.awk b/xCAT-genesis-scripts/usr/bin/minixcatd.awk similarity index 100% rename from xCAT-genesis-scripts/bin/minixcatd.awk rename to xCAT-genesis-scripts/usr/bin/minixcatd.awk diff --git a/xCAT-genesis-scripts/bin/nextdestiny b/xCAT-genesis-scripts/usr/bin/nextdestiny similarity index 100% rename from xCAT-genesis-scripts/bin/nextdestiny rename to xCAT-genesis-scripts/usr/bin/nextdestiny diff --git a/xCAT-genesis-scripts/bin/pseries_platform b/xCAT-genesis-scripts/usr/bin/pseries_platform similarity index 100% rename from xCAT-genesis-scripts/bin/pseries_platform rename to xCAT-genesis-scripts/usr/bin/pseries_platform diff --git a/xCAT-genesis-scripts/bin/raidcmd b/xCAT-genesis-scripts/usr/bin/raidcmd similarity index 100% rename from xCAT-genesis-scripts/bin/raidcmd rename to xCAT-genesis-scripts/usr/bin/raidcmd diff --git a/xCAT-genesis-scripts/bin/raidutils b/xCAT-genesis-scripts/usr/bin/raidutils similarity index 100% rename from xCAT-genesis-scripts/bin/raidutils rename to xCAT-genesis-scripts/usr/bin/raidutils diff --git a/xCAT-genesis-scripts/bin/remoteimmsetup b/xCAT-genesis-scripts/usr/bin/remoteimmsetup similarity index 100% rename from xCAT-genesis-scripts/bin/remoteimmsetup rename to xCAT-genesis-scripts/usr/bin/remoteimmsetup diff --git a/xCAT-genesis-scripts/bin/restart b/xCAT-genesis-scripts/usr/bin/restart similarity index 100% rename from xCAT-genesis-scripts/bin/restart rename to xCAT-genesis-scripts/usr/bin/restart diff --git a/xCAT-genesis-scripts/bin/udpcat.awk b/xCAT-genesis-scripts/usr/bin/udpcat.awk similarity index 100% rename from xCAT-genesis-scripts/bin/udpcat.awk rename to xCAT-genesis-scripts/usr/bin/udpcat.awk diff --git a/xCAT-genesis-scripts/bin/update_flash b/xCAT-genesis-scripts/usr/bin/update_flash similarity index 100% rename from xCAT-genesis-scripts/bin/update_flash rename to xCAT-genesis-scripts/usr/bin/update_flash diff --git a/xCAT-genesis-scripts/bin/update_flash_nv b/xCAT-genesis-scripts/usr/bin/update_flash_nv similarity index 100% rename from xCAT-genesis-scripts/bin/update_flash_nv rename to xCAT-genesis-scripts/usr/bin/update_flash_nv diff --git a/xCAT-genesis-scripts/bin/updateflag.awk b/xCAT-genesis-scripts/usr/bin/updateflag.awk similarity index 100% rename from xCAT-genesis-scripts/bin/updateflag.awk rename to xCAT-genesis-scripts/usr/bin/updateflag.awk diff --git a/xCAT-genesis-scripts/sbin/loadmlxeth b/xCAT-genesis-scripts/usr/sbin/loadmlxeth similarity index 100% rename from xCAT-genesis-scripts/sbin/loadmlxeth rename to xCAT-genesis-scripts/usr/sbin/loadmlxeth diff --git a/xCAT-genesis-scripts/sbin/setupimmnic b/xCAT-genesis-scripts/usr/sbin/setupimmnic similarity index 100% rename from xCAT-genesis-scripts/sbin/setupimmnic rename to xCAT-genesis-scripts/usr/sbin/setupimmnic diff --git a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec index 2a35f23af..4fb917727 100755 --- a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec +++ b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec @@ -71,32 +71,32 @@ touch /etc/xcat/genesis-scripts-updated %Files %defattr(-,root,root) #%dir %attr(-,root,root) %{rpminstallroot} -%{rpminstallroot}/bin/allowcred.awk -%{rpminstallroot}/bin/bmcsetup -%{rpminstallroot}/bin/raidcmd -%{rpminstallroot}/bin/raidutils -%{rpminstallroot}/bin/diskdiscover -%{rpminstallroot}/bin/configraid -%{rpminstallroot}/bin/dodiscovery -%{rpminstallroot}/bin/dosysclone -%{rpminstallroot}/bin/doxcat -%{rpminstallroot}/bin/getadapter -%{rpminstallroot}/bin/getcert -%{rpminstallroot}/bin/getdestiny -%{rpminstallroot}/bin/getipmi -%{rpminstallroot}/bin/ifup -%{rpminstallroot}/bin/minixcatd.awk -%{rpminstallroot}/bin/nextdestiny -%{rpminstallroot}/bin/remoteimmsetup -%{rpminstallroot}/bin/udpcat.awk -%{rpminstallroot}/bin/updateflag.awk -%{rpminstallroot}/bin/pseries_platform -%{rpminstallroot}/bin/update_flash -%{rpminstallroot}/bin/update_flash_nv -%{rpminstallroot}/bin/restart +%{rpminstallroot}/usr/bin/allowcred.awk +%{rpminstallroot}/usr/bin/bmcsetup +%{rpminstallroot}/usr/bin/raidcmd +%{rpminstallroot}/usr/bin/raidutils +%{rpminstallroot}/usr/bin/diskdiscover +%{rpminstallroot}/usr/bin/configraid +%{rpminstallroot}/usr/bin/dodiscovery +%{rpminstallroot}/usr/bin/dosysclone +%{rpminstallroot}/usr/bin/doxcat +%{rpminstallroot}/usr/bin/getadapter +%{rpminstallroot}/usr/bin/getcert +%{rpminstallroot}/usr/bin/getdestiny +%{rpminstallroot}/usr/bin/getipmi +%{rpminstallroot}/usr/bin/ifup +%{rpminstallroot}/usr/bin/minixcatd.awk +%{rpminstallroot}/usr/bin/nextdestiny +%{rpminstallroot}/usr/bin/remoteimmsetup +%{rpminstallroot}/usr/bin/udpcat.awk +%{rpminstallroot}/usr/bin/updateflag.awk +%{rpminstallroot}/usr/bin/pseries_platform +%{rpminstallroot}/usr/bin/update_flash +%{rpminstallroot}/usr/bin/update_flash_nv +%{rpminstallroot}/usr/bin/restart %{rpminstallroot}/etc/init.d/functions %{rpminstallroot}/etc/udev/rules.d/99-imm.rules %{rpminstallroot}/etc/udev/rules.d/98-mlx.rules -%{rpminstallroot}/sbin/setupimmnic -%{rpminstallroot}/sbin/loadmlxeth +%{rpminstallroot}/usr/sbin/setupimmnic +%{rpminstallroot}/usr/sbin/loadmlxeth %exclude %{rpminstallroot}/debian/* From 03d6c72622d2df7e8ca54f634a66813f4e7623fd Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Fri, 12 Jan 2018 16:17:54 +0800 Subject: [PATCH 04/30] Minor tweaks for the debian packaging script of xcat-genesis-base --- .../debuild-xcat-genesis-base | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/xCAT-genesis-builder/debuild-xcat-genesis-base b/xCAT-genesis-builder/debuild-xcat-genesis-base index 1b952adc3..d897039ee 100755 --- a/xCAT-genesis-builder/debuild-xcat-genesis-base +++ b/xCAT-genesis-builder/debuild-xcat-genesis-base @@ -1,7 +1,15 @@ #!/bin/bash +# +# This is a dirty script for convert an xCAT-genesis-base rpm package to +# a debian package. +# # xCAT-genesis-base-x86_64-2.13.10-snap201801090246.noarch.rpm RPM_PACKAGE="$1" +[ -n "${RPM_PACKAGE}" ] || + echo "Usage: ${0##*/} /path/to/xCAT-genesis-base.rpm" && exit 0 + +set -x [ -n "${RPM_PACKAGE}" ] || exit 1 [ -f "${RPM_PACKAGE}" ] || exit 1 @@ -29,11 +37,16 @@ fi cat >"${EXTRACT_DIR}/debian/preinst" <<-EOF #!/bin/bash -rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/bin -rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/sbin -rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/lib -rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/lib64 -rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/var/run +[ -d /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/bin ] && + rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/bin +[ -d /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/sbin ] && + rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/sbin +[ -d /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/lib ] && + rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/lib +[ -d /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/lib64 ] && + rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/lib64 +[ -d /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/var/run ] && + rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/var/run EOF ( cd "${EXTRACT_DIR}" && debian/rules binary ) From 7b4af8f393ee28d0edb8a7ba4e3e574235556692 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 15 Jan 2018 11:49:29 -0500 Subject: [PATCH 05/30] Support for OpenBMC PowerRestorePolicy attribute --- xCAT-server/lib/xcat/plugins/openbmc.pm | 55 +++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index c70967595..cdde35141 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -539,6 +539,14 @@ my %status_info = ( RSPCONFIG_API_CONFIG_OFF_RESPONSE => { process => \&rspconfig_api_config_response, }, + RSPCONFIG_API_CONFIG_ATTR_REQUEST => { + method => "PUT", + init_url => "$openbmc_project_url", + data => "false", + }, + RSPCONFIG_API_CONFIG_ATTR_RESPONSE => { + process => \&rspconfig_api_config_response, + }, RSPCONFIG_API_CONFIG_QUERY_REQUEST => { method => "GET", init_url => "$openbmc_project_url", @@ -552,6 +560,7 @@ my %status_info = ( # For example: rspconfig # rspconfig =0 # rspconfig =1 +# rspconfig = # # my %api_config_info = ( @@ -571,6 +580,19 @@ my %api_config_info = ( type => "boolean", subcommand => "powersupplyredundency", }, + RSPCONFIG_POWERRESTORE_POLICY => { + command => "rspconfig", + url => "/control/host0/power_restore_policy", + attr_url => "PowerRestorePolicy", + display_name => "PowerRestorePolicy", + type => "attribute", + subcommand => "powerrestorepolicy", + attr_value => { + restore => "xyz.openbmc_project.Control.Power.RestorePolicy.Policy.Restore", + always_on => "xyz.openbmc_project.Control.Power.RestorePolicy.Policy.AlwaysOn", + always_off => "xyz.openbmc_project.Control.Power.RestorePolicy.Policy.AlwaysOff", + }, + }, ); $::RESPONSE_OK = "200 OK"; @@ -1508,18 +1530,25 @@ sub parse_command_status { my $subcommand_key = $1; my $subcommand_value = $2; - if ($subcommand_value eq "1") { + if (($subcommand_value eq "1") && ($api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{type} eq "boolean")) { # Setup chain for subcommand=1 $next_status{LOGIN_RESPONSE} = "RSPCONFIG_API_CONFIG_ON_REQUEST"; $status_info{RSPCONFIG_API_CONFIG_ON_REQUEST}{init_url} = $status_info{RSPCONFIG_API_CONFIG_ON_REQUEST}{init_url} . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{url} . "/attr/" . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_url}; $next_status{RSPCONFIG_API_CONFIG_ON_REQUEST} = "RSPCONFIG_API_CONFIG_ON_RESPONSE"; } - elsif ($subcommand_value eq "0") { + elsif (($subcommand_value eq "0") && ($api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{type} eq "boolean")) { # Setup chain for subcommand=0 $next_status{LOGIN_RESPONSE} = "RSPCONFIG_API_CONFIG_OFF_REQUEST"; $status_info{RSPCONFIG_API_CONFIG_OFF_REQUEST}{init_url} = $status_info{RSPCONFIG_API_CONFIG_OFF_REQUEST}{init_url} . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{url} . "/attr/" . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_url}; $next_status{RSPCONFIG_API_CONFIG_OFF_REQUEST} = "RSPCONFIG_API_CONFIG_OFF_RESPONSE"; } + elsif (($api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{type} eq "attribute") && (exists $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_value}{$subcommand_value})) { + # Setup chain for subcommand= + $next_status{LOGIN_RESPONSE} = "RSPCONFIG_API_CONFIG_ATTR_REQUEST"; + $status_info{RSPCONFIG_API_CONFIG_ATTR_REQUEST}{init_url} = $status_info{RSPCONFIG_API_CONFIG_ATTR_REQUEST}{init_url} . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{url} . "/attr/" . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_url}; + $status_info{RSPCONFIG_API_CONFIG_ATTR_REQUEST}{data} = $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_value}{$subcommand_value}; + $next_status{RSPCONFIG_API_CONFIG_ATTR_REQUEST} = "RSPCONFIG_API_CONFIG_ATTR_RESPONSE"; + } else { # Everything else is invalid xCAT::SvrUtils::sendmsg([1, "Invalid value $subcommand_value for 'rspconfig $subcommand_key=$subcommand_value' command"], $callback); @@ -3406,6 +3435,14 @@ sub rspconfig_api_config_response { xCAT::SvrUtils::sendmsg("Error unsetting RSPCONFIG_API_CONFIG_OFF_RESPONSE", $callback, $node); } } + elsif ($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_ATTR_RESPONSE") { + if ($response_info->{'message'} eq $::RESPONSE_OK) { + xCAT::SvrUtils::sendmsg("BMC Setting ". $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{display_name} . "...", $callback, $node); + } + else { + xCAT::SvrUtils::sendmsg("Error unsetting RSPCONFIG_API_CONFIG_OFF_RESPONSE", $callback, $node); + } + } elsif ($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_QUERY_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { foreach my $key_url (keys %{$response_info->{data}}) { @@ -3415,11 +3452,21 @@ sub rspconfig_api_config_response { last; } } - if (scalar($value) >= 0) { + if (($value eq "0") || ($value eq "1")) { + # If 0 or 1 display as a boolean value xCAT::SvrUtils::sendmsg($api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{display_name} . ": $value", $callback, $node); } else { - xCAT::SvrUtils::sendmsg("Unable to query value for " . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_url}, $callback, $node); + # If not a boolean value, display the last component of the attribute + # For example "xyz.openbmc_project.Control.Power.RestorePolicy.Policy.Restore" + # will be displayed as "Restore" + my @attr_value = split('\.', $value); + if (@attr_value[-1]) { + xCAT::SvrUtils::sendmsg($api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{display_name} . ": @attr_value[-1]", $callback, $node); + } + else { + xCAT::SvrUtils::sendmsg("Unable to query value for " . $api_config_info{$::RSPCONFIG_CONFIGURED_API_KEY}{attr_url}, $callback, $node); + } } } else { From daae8eed58c24ce188af481bd8a5028f2db10ecf Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Mon, 15 Jan 2018 15:28:57 -0500 Subject: [PATCH 06/30] Add documentation for PDU support. --- docs/source/advanced/pdu/crpdu.rst | 109 ++++++++++++++++++++ docs/source/advanced/pdu/index.rst | 4 +- docs/source/advanced/pdu/irpdu.rst | 151 +++++++++++++++++++++++++++ docs/source/advanced/pdu/pdu.rst | 157 +++++------------------------ 4 files changed, 291 insertions(+), 130 deletions(-) create mode 100644 docs/source/advanced/pdu/crpdu.rst create mode 100644 docs/source/advanced/pdu/irpdu.rst diff --git a/docs/source/advanced/pdu/crpdu.rst b/docs/source/advanced/pdu/crpdu.rst new file mode 100644 index 000000000..eea318d72 --- /dev/null +++ b/docs/source/advanced/pdu/crpdu.rst @@ -0,0 +1,109 @@ +Collaborative PDU +================= + +Collaborative PDU is also refer as Coral PDU, it controls power for compute Rack. + + +Pre-Defined PDU Objects +----------------------- + +User needs to pre-defined PDU node object if want to run pdudiscover command. :: + + mkdef coralpdu groups=pdu mgt=pdu nodetype=pdu (required) + +all other attributes can be set by chdef command or pdudisocover command. :: + + --switch required for pdudiscover command to do mapping + --switchport required for pdudiscover command to do mapping + --ip ip address of the pdu. + --mac can be filled in by pdudiscover command + --pdutype crpdu(for coral pdu) or irpdu(for infrastructure PDUs) + + +If user want to configure snmp other than default value, the following attributes need to be set. :: + + --community community string for coral pdu + --snmpversion snmp version number, required if configure snmpv3 for coral pdu + --snmpuser snmpv3 user name, required if configure snmpv3 for coral pdu + --authkey auth passphrase for snmpv3 configuration + --authtype auth protocol (MD5|SHA) for snmpv3 configuration + --privkey priv passphrase for snmpv3 configuration + --privtype priv protocol (AES|DES) for snmpv3 configuration + --seclevel security level (noAuthNoPriv|authNoPriv|authPriv) for snmpv3 configuration + +Make sure run makehosts after pre-defined PDU. :: + + makehosts coralpdu + + +Configure PDUs +-------------- + +After pre-defined PDUs, user can use **pdudisocver --range ip_range --setup** to configure the PDUs, it covers following commands: + + * To configure passwordless of Coral PDU: :: + + # rspconfig coralpdu sshcfg + + * To change hostname of Coral PDU: :: + + # rspconfig coralpdu hosname=f5pdu3 + + * To change ip address of PDU: :: + + # rsconfig coralpdu ip=x.x.x.x netmaks=255.x.x.x + + * To configure SNMP community string or snmpv3 of PDU (the attribute needs to pre-defined): :: + + # rspconfig coralpdu snmpcfg + + +Remote Power Control of PDU +--------------------------- + +Use the rpower command to remotely power on and off of PDU. + + * To check power stat of PDU: :: + + # rpower coralpdu stat + + * To power off the PDU: :: + + # rpower coralpdu off + + * To power on the PDU: :: + + # rpower coralpdu on + +Coral PDUs have three relays, the following commands are for individual relay support of PDU: + + * To check power stat of relay: :: + + # rpower coralpdu relay=1 stat + + * To power off the relay: :: + + # rpower coralpdu relay=2 off + + * To power on the relay: :: + + # rpower coralpdu relay=3 on + + +Show Monitor Data +----------------- + +Use the rvitals command to show realtime monitor data(inpute voltage, current, power) of PDU. :: + + # rvitals coralpdu + + +Show manufacture information +----------------------------- + +Use the rinv command to show MFR information of PDU :: + + # rinv coralpdu + + + diff --git a/docs/source/advanced/pdu/index.rst b/docs/source/advanced/pdu/index.rst index 5141a09f5..b27f754f2 100644 --- a/docs/source/advanced/pdu/index.rst +++ b/docs/source/advanced/pdu/index.rst @@ -1,10 +1,12 @@ PDUs ==== -Power Distribution Units (PDUs) are devices that distribute power to servers in a frame. Intelligent PDUs have the capability of monitoring the amount of power that is being used by devices plugged into it. +Power Distribution Units (PDUs) are devices that distribute power to servers in a frame. It has the capability of monitoring the amount of power that is being used by devices plugged into it and cycle power to individual receptacles. xCAT can support two kinds of PDUs on the fields, infrastructure PDU (irpdu) and collaborative PDU (crpdu). These two types of PDU have different design and implementation. xCAT has different code path to maintains PDU commands via **pdutype**. .. toctree:: :maxdepth: 2 pdu.rst + irpdu.rst + crpdu.rst diff --git a/docs/source/advanced/pdu/irpdu.rst b/docs/source/advanced/pdu/irpdu.rst new file mode 100644 index 000000000..08c779154 --- /dev/null +++ b/docs/source/advanced/pdu/irpdu.rst @@ -0,0 +1,151 @@ +Infrastructure PDU +================== + + +PDU Commands +------------ + +Administrators will need to know the exact mapping of the outlets to each server in the frame. xCAT cannot validate the physical cable is connected to the correct server. + +Add a ``pdu`` attribute to the compute node definition in the form "PDU_Name:outlet": :: + + # + # Compute server cn01 has two power supplies + # connected to outlet 6 and 7 on pdu=f5pdu3 + # + chdef cn01 pdu=f5pdu3:6,f5pdu3:7 + + +The following commands are supported against a compute node: + + * Check the pdu status for a compute node: :: + + # rpower cn01 pdustat + cn01: f5pdu3 outlet 6 is on + cn01: f5pdu3 outlet 7 is on + + + * Power off the PDU outlets on a compute node: :: + + # rpower cn01 pduoff + cn01: f5pdu3 outlet 6 is off + cn01: f5pdu3 outlet 7 is off + + * Power on the PDU outlets on a compute node: :: + + # rpower cn01 pduon + cn01: f5pdu3 outlet 6 is on + cn01: f5pdu3 outlet 7 is on + + * Power cycling the PDU outlets on a compute node: :: + + # rpower cn01 pdureset + cn01: f5pdu3 outlet 6 is reset + cn01: f5pdu3 outlet 7 is reset + +The following commands are supported against a PDU: + + * Check the status of the full PDU: :: + + # rpower f5pdu3 stat + f5pdu3: outlet 1 is on + f5pdu3: outlet 2 is on + f5pdu3: outlet 3 is on + f5pdu3: outlet 4 is on + f5pdu3: outlet 5 is on + f5pdu3: outlet 6 is off + f5pdu3: outlet 7 is off + f5pdu3: outlet 8 is on + f5pdu3: outlet 9 is on + f5pdu3: outlet 10 is on + f5pdu3: outlet 11 is on + f5pdu3: outlet 12 is on + + * Power off the full PDU: :: + + # rpower f5pdu3 off + f5pdu3: outlet 1 is off + f5pdu3: outlet 2 is off + f5pdu3: outlet 3 is off + f5pdu3: outlet 4 is off + f5pdu3: outlet 5 is off + f5pdu3: outlet 6 is off + f5pdu3: outlet 7 is off + f5pdu3: outlet 8 is off + f5pdu3: outlet 9 is off + f5pdu3: outlet 10 is off + f5pdu3: outlet 11 is off + f5pdu3: outlet 12 is off + + * Power on the full PDU: :: + + # rpower f5pdu3 on + f5pdu3: outlet 1 is on + f5pdu3: outlet 2 is on + f5pdu3: outlet 3 is on + f5pdu3: outlet 4 is on + f5pdu3: outlet 5 is on + f5pdu3: outlet 6 is on + f5pdu3: outlet 7 is on + f5pdu3: outlet 8 is on + f5pdu3: outlet 9 is on + f5pdu3: outlet 10 is on + f5pdu3: outlet 11 is on + f5pdu3: outlet 12 is on + + * Power reset the full PDU: :: + + # rpower f5pdu3 reset + f5pdu3: outlet 1 is reset + f5pdu3: outlet 2 is reset + f5pdu3: outlet 3 is reset + f5pdu3: outlet 4 is reset + f5pdu3: outlet 5 is reset + f5pdu3: outlet 6 is reset + f5pdu3: outlet 7 is reset + f5pdu3: outlet 8 is reset + f5pdu3: outlet 9 is reset + f5pdu3: outlet 10 is reset + f5pdu3: outlet 11 is reset + f5pdu3: outlet 12 is reset + + * PDU inventory information: :: + + # rinv f6pdu16 + f6pdu16: PDU Software Version: "OPDP_sIBM_v01.3_2" + f6pdu16: PDU Machine Type: "1U" + f6pdu16: PDU Model Number: "dPDU4230" + f6pdu16: PDU Part Number: "46W1608" + f6pdu16: PDU Name: "IBM PDU" + f6pdu16: PDU Serial Number: "4571S9" + f6pdu16: PDU Description: "description" + + * PDU and outlet power information: :: + + # rvitals f6pdu15 + f6pdu15: Voltage Warning: 0 + f6pdu15: outlet 1 Current: 0 mA + f6pdu15: outlet 1 Max Capacity of the current: 16000 mA + f6pdu15: outlet 1 Current Threshold Warning: 9600 mA + f6pdu15: outlet 1 Current Threshold Critical: 12800 mA + f6pdu15: outlet 1 Last Power Reading: 0 Watts + f6pdu15: outlet 2 Current: 0 mA + f6pdu15: outlet 2 Max Capacity of the current: 16000 mA + f6pdu15: outlet 2 Current Threshold Warning: 9600 mA + f6pdu15: outlet 2 Current Threshold Critical: 12800 mA + f6pdu15: outlet 2 Last Power Reading: 0 Watts + f6pdu15: outlet 3 Current: 1130 mA + f6pdu15: outlet 3 Max Capacity of the current: 16000 mA + f6pdu15: outlet 3 Current Threshold Warning: 9600 mA + f6pdu15: outlet 3 Current Threshold Critical: 12800 mA + f6pdu15: outlet 3 Last Power Reading: 217 Wattsv + +**Note:** For BMC based compute nodes, turning the PDU outlet power on does not automatically power on the compute side. Users will need to issue ``rpower on`` to power on the compute node after the BMC boots. + + + + + + + + diff --git a/docs/source/advanced/pdu/pdu.rst b/docs/source/advanced/pdu/pdu.rst index a8566b5f8..64de43178 100644 --- a/docs/source/advanced/pdu/pdu.rst +++ b/docs/source/advanced/pdu/pdu.rst @@ -1,17 +1,39 @@ -PDU -=== +Discovering PDUs +================ -xCAT provides basic remote management for each power outlet plugged into the PDUs using SNMP communication. This documentation will focus on configuration of the PDU and Node objects to allow xCAT to control power at the PDU outlet level. +xCAT provides `pdudiscover` command to discover the PDUs that are attached to the neighboring subnets on xCAT management node. :: + + pdudiscover [|--range ipranges] [-r|-x|-z] [-w] [-V|--verbose] [--setup] + +xCAT uses snmp scan method to discover PDU. Make sure net-snmp-utils package is installed on xCAT MN in order to use snmpwalk command. :: + + Options: + --range Specify one or more IP ranges. Each can be an ip address (10.1.2.3) or an ip range + (10.1.2.0/24). If the range is huge, for example, 192.168.1.1/8, the pdu + discover may take a very long time to scan. So the range should be exactly + specified. It accepts multiple formats. For example: + 192.168.1.1/24, 40-41.1-2.3-4.1-100. + + If the range is not specified, the command scans all the subnets that the active + network interfaces (eth0, eth1) are on where this command is issued. + -r Display Raw responses. + -x XML formatted output. + -z Stanza formatted output. + -w Writes output to xCAT database. + --setup Process switch-based pdu discovery and configure the PDUs(it included passwordless , change ip address from dhcp to static and snmp configuration). It required predefined PDU node definition with switch name and switch port attributes for mapping. (Notes: only support for crpdu for now for this options) Define PDU Objects ------------------ - #. Define pdu object :: - mkdef f5pdu3 groups=pdu ip=50.0.0.8 mgt=pdu nodetype=pdu + mkdef f5pdu3 groups=pdu ip=50.0.0.8 mgt=pdu nodetype=pdu pdutype=irpdu + +#. Define switch attribute for pdu object will use for pdudiscover **--setup** options. :: + + chdef f5pdu3 switch=mid08 switchport=3 #. Add hostname to /etc/hosts:: @@ -19,129 +41,6 @@ Define PDU Objects #. Verify the SNMP command responds against the PDU: :: - snmpwalk -v1 -cpublic -mALL f5pdu3 .1.3.6.1.2.1.1 - - -Define PDU Attribute --------------------- - -Administrators will need to know the exact mapping of the outlets to each server in the frame. xCAT cannot validate the physical cable is connected to the correct server. - -Add a ``pdu`` attribute to the compute node definition in the form "PDU_Name:outlet": :: - - # - # Compute server cn01 has two power supplies - # connected to outlet 6 and 7 on pdu=f5pdu3 - # - chdef cn01 pdu=f5pdu3:6,f5pdu3:7 - - -Verify the setting: ``lsdef cn01 -i pdu`` - - -PDU Commands ------------- - -The following commands are supported against a compute node: - - * Check the pdu status for a compute node: :: - - # rpower cn01 pdustat - cn01: f5pdu3 outlet 6 is on - cn01: f5pdu3 outlet 7 is on - - - * Power off the PDU outlets on a compute node: :: - - # rpower cn01 pduoff - cn01: f5pdu3 outlet 6 is off - cn01: f5pdu3 outlet 7 is off - - * Power on the PDU outlets on a compute node: :: - - # rpower cn01 pduon - cn01: f5pdu3 outlet 6 is on - cn01: f5pdu3 outlet 7 is on - - * Power cycling the PDU outlets on a compute node: :: - - # rpower cn01 pdureset - cn01: f5pdu3 outlet 6 is reset - cn01: f5pdu3 outlet 7 is reset - -The following commands are supported against a PDU: - - * Check the status of the full PDU: :: - - # rinv f5pdu3 - f5pdu3: outlet 1 is on - f5pdu3: outlet 2 is on - f5pdu3: outlet 3 is on - f5pdu3: outlet 4 is on - f5pdu3: outlet 5 is on - f5pdu3: outlet 6 is off - f5pdu3: outlet 7 is off - f5pdu3: outlet 8 is on - f5pdu3: outlet 9 is on - f5pdu3: outlet 10 is on - f5pdu3: outlet 11 is on - f5pdu3: outlet 12 is on - - * Power off the full PDU: :: - - # rpower f5pdu3 off - f5pdu3: outlet 1 is off - f5pdu3: outlet 2 is off - f5pdu3: outlet 3 is off - f5pdu3: outlet 4 is off - f5pdu3: outlet 5 is off - f5pdu3: outlet 6 is off - f5pdu3: outlet 7 is off - f5pdu3: outlet 8 is off - f5pdu3: outlet 9 is off - f5pdu3: outlet 10 is off - f5pdu3: outlet 11 is off - f5pdu3: outlet 12 is off - - * Power on the full PDU: :: - - # rpower f5pdu3 on - f5pdu3: outlet 1 is on - f5pdu3: outlet 2 is on - f5pdu3: outlet 3 is on - f5pdu3: outlet 4 is on - f5pdu3: outlet 5 is on - f5pdu3: outlet 6 is on - f5pdu3: outlet 7 is on - f5pdu3: outlet 8 is on - f5pdu3: outlet 9 is on - f5pdu3: outlet 10 is on - f5pdu3: outlet 11 is on - f5pdu3: outlet 12 is on - - * Power reset the full PDU: :: - - # rpower f5pdu3 reset - f5pdu3: outlet 1 is reset - f5pdu3: outlet 2 is reset - f5pdu3: outlet 3 is reset - f5pdu3: outlet 4 is reset - f5pdu3: outlet 5 is reset - f5pdu3: outlet 6 is reset - f5pdu3: outlet 7 is reset - f5pdu3: outlet 8 is reset - f5pdu3: outlet 9 is reset - f5pdu3: outlet 10 is reset - f5pdu3: outlet 11 is reset - f5pdu3: outlet 12 is reset - - -**Note:** For BMC based compute nodes, turning the PDU outlet power on does not automatically power on the compute side. Users will need to issue ``rpower on`` to power on the compute node after the BMC boots. - - - - - - + snmpwalk -v1 -cpublic -mALL f5pdu3 system From e718235ae2a2be33a0fdbe3748178e29913cb426 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 4 Apr 2017 09:50:05 -0400 Subject: [PATCH 07/30] macdata can be a string, ignore that as well --- xCAT-server/lib/xcat/plugins/ipmi.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 55eb9955c..112f51390 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -4696,7 +4696,7 @@ sub parseboard { my $macdata = $boardinf{extra}->[6]->{value}; my $macstring = "1"; my $macprefix; - while ($macdata and $macstring !~ /00:00:00:00:00:00/ and not ref $global_sessdata->{currmacs}) { + while ($macdata and ref $macdata and $macstring !~ /00:00:00:00:00:00/ and not ref $global_sessdata->{currmacs}) { my @currmac = splice @$macdata, 0, 6; unless ((scalar @currmac) == 6) { last; From ec7a7fc325e80ac9faf73b992c60829011618201 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Tue, 16 Jan 2018 13:46:43 -0500 Subject: [PATCH 08/30] modify changes from Mark's review --- docs/source/advanced/pdu/crpdu.rst | 14 +++---- docs/source/advanced/pdu/index.rst | 2 +- docs/source/advanced/pdu/irpdu.rst | 62 +++++++++++++++--------------- docs/source/advanced/pdu/pdu.rst | 2 +- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/docs/source/advanced/pdu/crpdu.rst b/docs/source/advanced/pdu/crpdu.rst index eea318d72..e527c0169 100644 --- a/docs/source/advanced/pdu/crpdu.rst +++ b/docs/source/advanced/pdu/crpdu.rst @@ -1,13 +1,13 @@ Collaborative PDU ================= -Collaborative PDU is also refer as Coral PDU, it controls power for compute Rack. +Collaborative PDU is also referred as Coral PDU, it controls power for compute Rack. Pre-Defined PDU Objects ----------------------- -User needs to pre-defined PDU node object if want to run pdudiscover command. :: +A pre-defined PDU node object is required before running pdudiscover command. :: mkdef coralpdu groups=pdu mgt=pdu nodetype=pdu (required) @@ -20,7 +20,7 @@ all other attributes can be set by chdef command or pdudisocover command. :: --pdutype crpdu(for coral pdu) or irpdu(for infrastructure PDUs) -If user want to configure snmp other than default value, the following attributes need to be set. :: +The following attributes need to be set in order to configure snmp with non-default values. :: --community community string for coral pdu --snmpversion snmp version number, required if configure snmpv3 for coral pdu @@ -31,7 +31,7 @@ If user want to configure snmp other than default value, the following attribute --privtype priv protocol (AES|DES) for snmpv3 configuration --seclevel security level (noAuthNoPriv|authNoPriv|authPriv) for snmpv3 configuration -Make sure run makehosts after pre-defined PDU. :: +Make sure to run makehosts after pre-defined PDU. :: makehosts coralpdu @@ -39,7 +39,7 @@ Make sure run makehosts after pre-defined PDU. :: Configure PDUs -------------- -After pre-defined PDUs, user can use **pdudisocver --range ip_range --setup** to configure the PDUs, it covers following commands: +After pre-defining PDUs, user can use **pdudisocver --range ip_range --setup** to configure the PDUs, or following commands can be used: * To configure passwordless of Coral PDU: :: @@ -61,7 +61,7 @@ After pre-defined PDUs, user can use **pdudisocver --range ip_range --setup** to Remote Power Control of PDU --------------------------- -Use the rpower command to remotely power on and off of PDU. +Use the rpower command to remotely power on and off PDU. * To check power stat of PDU: :: @@ -93,7 +93,7 @@ Coral PDUs have three relays, the following commands are for individual relay su Show Monitor Data ----------------- -Use the rvitals command to show realtime monitor data(inpute voltage, current, power) of PDU. :: +Use the rvitals command to show realtime monitor data(input voltage, current, power) of PDU. :: # rvitals coralpdu diff --git a/docs/source/advanced/pdu/index.rst b/docs/source/advanced/pdu/index.rst index b27f754f2..42b371ae7 100644 --- a/docs/source/advanced/pdu/index.rst +++ b/docs/source/advanced/pdu/index.rst @@ -1,7 +1,7 @@ PDUs ==== -Power Distribution Units (PDUs) are devices that distribute power to servers in a frame. It has the capability of monitoring the amount of power that is being used by devices plugged into it and cycle power to individual receptacles. xCAT can support two kinds of PDUs on the fields, infrastructure PDU (irpdu) and collaborative PDU (crpdu). These two types of PDU have different design and implementation. xCAT has different code path to maintains PDU commands via **pdutype**. +Power Distribution Units (PDUs) are devices that distribute power to servers in a frame. They have the capability of monitoring the amount of power that is being used by devices plugged into it and cycle power to individual receptacles. xCAT can support two kinds of PDUs, infrastructure PDU (irpdu) and collaborative PDU (crpdu). These two types of PDU have different design and implementation. xCAT has different code path to maintains PDU commands via **pdutype**. .. toctree:: diff --git a/docs/source/advanced/pdu/irpdu.rst b/docs/source/advanced/pdu/irpdu.rst index 08c779154..b35193b50 100644 --- a/docs/source/advanced/pdu/irpdu.rst +++ b/docs/source/advanced/pdu/irpdu.rst @@ -25,19 +25,19 @@ The following commands are supported against a compute node: cn01: f5pdu3 outlet 7 is on - * Power off the PDU outlets on a compute node: :: + * Power off the PDU outlets for a compute node: :: # rpower cn01 pduoff cn01: f5pdu3 outlet 6 is off cn01: f5pdu3 outlet 7 is off - * Power on the PDU outlets on a compute node: :: + * Power on the PDU outlets for a compute node: :: # rpower cn01 pduon cn01: f5pdu3 outlet 6 is on cn01: f5pdu3 outlet 7 is on - * Power cycling the PDU outlets on a compute node: :: + * Power cycling the PDU outlets for a compute node: :: # rpower cn01 pdureset cn01: f5pdu3 outlet 6 is reset @@ -109,38 +109,38 @@ The following commands are supported against a PDU: f5pdu3: outlet 11 is reset f5pdu3: outlet 12 is reset - * PDU inventory information: :: + * PDU inventory information: :: - # rinv f6pdu16 - f6pdu16: PDU Software Version: "OPDP_sIBM_v01.3_2" - f6pdu16: PDU Machine Type: "1U" - f6pdu16: PDU Model Number: "dPDU4230" - f6pdu16: PDU Part Number: "46W1608" - f6pdu16: PDU Name: "IBM PDU" - f6pdu16: PDU Serial Number: "4571S9" - f6pdu16: PDU Description: "description" + # rinv f6pdu16 + f6pdu16: PDU Software Version: "OPDP_sIBM_v01.3_2" + f6pdu16: PDU Machine Type: "1U" + f6pdu16: PDU Model Number: "dPDU4230" + f6pdu16: PDU Part Number: "46W1608" + f6pdu16: PDU Name: "IBM PDU" + f6pdu16: PDU Serial Number: "4571S9" + f6pdu16: PDU Description: "description" - * PDU and outlet power information: :: + * PDU and outlet power information: :: - # rvitals f6pdu15 - f6pdu15: Voltage Warning: 0 - f6pdu15: outlet 1 Current: 0 mA - f6pdu15: outlet 1 Max Capacity of the current: 16000 mA - f6pdu15: outlet 1 Current Threshold Warning: 9600 mA - f6pdu15: outlet 1 Current Threshold Critical: 12800 mA - f6pdu15: outlet 1 Last Power Reading: 0 Watts - f6pdu15: outlet 2 Current: 0 mA - f6pdu15: outlet 2 Max Capacity of the current: 16000 mA - f6pdu15: outlet 2 Current Threshold Warning: 9600 mA - f6pdu15: outlet 2 Current Threshold Critical: 12800 mA - f6pdu15: outlet 2 Last Power Reading: 0 Watts - f6pdu15: outlet 3 Current: 1130 mA - f6pdu15: outlet 3 Max Capacity of the current: 16000 mA - f6pdu15: outlet 3 Current Threshold Warning: 9600 mA - f6pdu15: outlet 3 Current Threshold Critical: 12800 mA - f6pdu15: outlet 3 Last Power Reading: 217 Wattsv + # rvitals f6pdu15 + f6pdu15: Voltage Warning: 0 + f6pdu15: outlet 1 Current: 0 mA + f6pdu15: outlet 1 Max Capacity of the current: 16000 mA + f6pdu15: outlet 1 Current Threshold Warning: 9600 mA + f6pdu15: outlet 1 Current Threshold Critical: 12800 mA + f6pdu15: outlet 1 Last Power Reading: 0 Watts + f6pdu15: outlet 2 Current: 0 mA + f6pdu15: outlet 2 Max Capacity of the current: 16000 mA + f6pdu15: outlet 2 Current Threshold Warning: 9600 mA + f6pdu15: outlet 2 Current Threshold Critical: 12800 mA + f6pdu15: outlet 2 Last Power Reading: 0 Watts + f6pdu15: outlet 3 Current: 1130 mA + f6pdu15: outlet 3 Max Capacity of the current: 16000 mA + f6pdu15: outlet 3 Current Threshold Warning: 9600 mA + f6pdu15: outlet 3 Current Threshold Critical: 12800 mA + f6pdu15: outlet 3 Last Power Reading: 217 Wattsv -**Note:** For BMC based compute nodes, turning the PDU outlet power on does not automatically power on the compute side. Users will need to issue ``rpower on`` to power on the compute node after the BMC boots. +**Note:** For BMC based compute nodes, turning the PDU outlet power on does not automatically power on the compute side. Users will need to issue ``rpower on`` to power on the compute side after the BMC boots. diff --git a/docs/source/advanced/pdu/pdu.rst b/docs/source/advanced/pdu/pdu.rst index 64de43178..0157ee8da 100644 --- a/docs/source/advanced/pdu/pdu.rst +++ b/docs/source/advanced/pdu/pdu.rst @@ -31,7 +31,7 @@ Define PDU Objects mkdef f5pdu3 groups=pdu ip=50.0.0.8 mgt=pdu nodetype=pdu pdutype=irpdu -#. Define switch attribute for pdu object will use for pdudiscover **--setup** options. :: +#. Define switch attribute for pdu object which will be used for pdudiscover **--setup** options. :: chdef f5pdu3 switch=mid08 switchport=3 From 858270e66657c95ef58b776b7e900f6ffd9c72e8 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 17 Jan 2018 13:03:42 +0800 Subject: [PATCH 09/30] Fix the error handling of command line argument checking --- xCAT-genesis-builder/debuild-xcat-genesis-base | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xCAT-genesis-builder/debuild-xcat-genesis-base b/xCAT-genesis-builder/debuild-xcat-genesis-base index d897039ee..2dc9e9066 100755 --- a/xCAT-genesis-builder/debuild-xcat-genesis-base +++ b/xCAT-genesis-builder/debuild-xcat-genesis-base @@ -6,8 +6,11 @@ # xCAT-genesis-base-x86_64-2.13.10-snap201801090246.noarch.rpm RPM_PACKAGE="$1" -[ -n "${RPM_PACKAGE}" ] || - echo "Usage: ${0##*/} /path/to/xCAT-genesis-base.rpm" && exit 0 +if [ -z "${RPM_PACKAGE}" ] +then + echo "Usage: ${0##*/} /path/to/xCAT-genesis-base.rpm" + exit 0 +fi set -x From 66c190d6123c556a49db178adc1210e26241d2b5 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 17 Jan 2018 13:52:32 +0800 Subject: [PATCH 10/30] Add dependency for xcat-genesis-base on Debian/Ubuntu --- xCAT-genesis-builder/debuild-xcat-genesis-base | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-genesis-builder/debuild-xcat-genesis-base b/xCAT-genesis-builder/debuild-xcat-genesis-base index 2dc9e9066..d6e029345 100755 --- a/xCAT-genesis-builder/debuild-xcat-genesis-base +++ b/xCAT-genesis-builder/debuild-xcat-genesis-base @@ -37,6 +37,8 @@ then sed -i -e 's/x86-64/amd64/g' "${EXTRACT_DIR}/debian/changelog" fi +sed -i -e "/^Description:/i Breaks: xcat-genesis-scripts-${PACKAGE_ARCH//x86_64/amd64} (<< 2.13.10)" "${EXTRACT_DIR}/debian/control" + cat >"${EXTRACT_DIR}/debian/preinst" <<-EOF #!/bin/bash From 0ce225b33932b2b3652a182ffec2efaa6ff42d69 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 17 Jan 2018 13:54:12 +0800 Subject: [PATCH 11/30] Update dependency for xCAT-genesis-base on Red Hat --- xCAT-genesis-builder/xCAT-genesis-base.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-genesis-builder/xCAT-genesis-base.spec b/xCAT-genesis-builder/xCAT-genesis-base.spec index 1b9cb3e46..76bd5644b 100644 --- a/xCAT-genesis-builder/xCAT-genesis-base.spec +++ b/xCAT-genesis-builder/xCAT-genesis-base.spec @@ -29,7 +29,7 @@ Vendor: IBM Corp. Summary: xCAT Genesis netboot image URL: https://xcat.org/ Source1: xCAT-genesis-base-%{tarch}.tar.bz2 -Conflicts: xCAT-genesis-scripts-%{tarch} < 1:2.13.9 +Conflicts: xCAT-genesis-scripts-%{tarch} < 1:2.13.10 Buildroot: %{_localstatedir}/tmp/xCAT-genesis BuildRequires: /usr/sbin/ntp-wait From 3461396e9ca27da8783371f157a8d304b3334dbe Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 17 Jan 2018 14:02:54 +0800 Subject: [PATCH 12/30] Fix permission in xCAT-genesis-builder.spec --- xCAT-genesis-builder/xCAT-genesis-builder.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-genesis-builder/xCAT-genesis-builder.spec b/xCAT-genesis-builder/xCAT-genesis-builder.spec index 8321f99e6..3a9b428a1 100644 --- a/xCAT-genesis-builder/xCAT-genesis-builder.spec +++ b/xCAT-genesis-builder/xCAT-genesis-builder.spec @@ -33,8 +33,8 @@ rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/genesis/builder cd $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/genesis/builder tar jxvf %{SOURCE1} -chmod +x $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/genesis/builder/buildrpm -chmod +x $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/genesis/builder/debuild-xcat-genesis-base +chmod 0755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/genesis/builder/buildrpm +chmod 0755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/genesis/builder/debuild-xcat-genesis-base cd - From a2d2ed1d344cc2837ce6789e835c30f6939aba2d Mon Sep 17 00:00:00 2001 From: ertaozh Date: Wed, 17 Jan 2018 03:36:40 -0500 Subject: [PATCH 13/30] From 2.13.10, the genesis scripts is moved to usr/bin or usr/sbin --- xCAT-genesis-scripts/debian/control-amd64 | 2 +- xCAT-genesis-scripts/debian/control-ppc64el | 2 +- xCAT-genesis-scripts/xCAT-genesis-scripts.spec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-genesis-scripts/debian/control-amd64 b/xCAT-genesis-scripts/debian/control-amd64 index 01223cc6f..38992a3c9 100644 --- a/xCAT-genesis-scripts/debian/control-amd64 +++ b/xCAT-genesis-scripts/debian/control-amd64 @@ -7,7 +7,7 @@ Standards-Version: 3.9.4 Package: xcat-genesis-scripts-amd64 Architecture: all -Depends: xcat-genesis-base-amd64 (>=2.13.2) +Depends: xcat-genesis-base-amd64 (>= 2.13.10) Conflicts: xcat-genesis-scripts, xcat-genesis-scripts-x86-64 Replaces: xcat-genesis-scripts, xcat-genesis-scripts-x86-64 Description: xCAT genesis diff --git a/xCAT-genesis-scripts/debian/control-ppc64el b/xCAT-genesis-scripts/debian/control-ppc64el index af9ad5ed8..53200fc05 100644 --- a/xCAT-genesis-scripts/debian/control-ppc64el +++ b/xCAT-genesis-scripts/debian/control-ppc64el @@ -7,7 +7,7 @@ Standards-Version: 3.9.4 Package: xcat-genesis-scripts-ppc64 Architecture: all -Depends: xcat-genesis-base-ppc64 (>=2.13.2) +Depends: xcat-genesis-base-ppc64 (>= 2.13.10) Conflicts: xcat-genesis-scripts Replaces: xcat-genesis-scripts Description: xCAT genesis diff --git a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec index 4fb917727..bab373378 100755 --- a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec +++ b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec @@ -29,7 +29,7 @@ Vendor: IBM Corp. Summary: xCAT Genesis netboot image - Core content URL: https://xcat.org/ Source1: xCAT-genesis-scripts.tar.bz2 -Requires: xCAT-genesis-base-%{tarch} >= 2:2.13.2 +Requires: xCAT-genesis-base-%{tarch} >= 2:2.13.10 Buildroot: %{_localstatedir}/tmp/xCAT-genesis Packager: IBM Corp. From 1f069848685411be2026f1ddc21c9d9afbd0918b Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Wed, 17 Jan 2018 21:06:48 -0500 Subject: [PATCH 14/30] types of PDUs --- docs/source/advanced/pdu/crpdu.rst | 2 +- docs/source/advanced/pdu/index.rst | 4 +++- docs/source/advanced/pdu/irpdu.rst | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/source/advanced/pdu/crpdu.rst b/docs/source/advanced/pdu/crpdu.rst index e527c0169..9933a80bc 100644 --- a/docs/source/advanced/pdu/crpdu.rst +++ b/docs/source/advanced/pdu/crpdu.rst @@ -1,7 +1,7 @@ Collaborative PDU ================= -Collaborative PDU is also referred as Coral PDU, it controls power for compute Rack. +Collaborative PDU is also referred as Coral PDU, it controls power for compute Rack. User can access PDU via SSH and can use the **PduManager** command to configure and manage the PDU product. Pre-Defined PDU Objects diff --git a/docs/source/advanced/pdu/index.rst b/docs/source/advanced/pdu/index.rst index 42b371ae7..625bfb269 100644 --- a/docs/source/advanced/pdu/index.rst +++ b/docs/source/advanced/pdu/index.rst @@ -1,7 +1,9 @@ PDUs ==== -Power Distribution Units (PDUs) are devices that distribute power to servers in a frame. They have the capability of monitoring the amount of power that is being used by devices plugged into it and cycle power to individual receptacles. xCAT can support two kinds of PDUs, infrastructure PDU (irpdu) and collaborative PDU (crpdu). These two types of PDU have different design and implementation. xCAT has different code path to maintains PDU commands via **pdutype**. +Power Distribution Units (PDUs) are devices that distribute power to servers in a frame. They have the capability of monitoring the amount of power that is being used by devices plugged into it and cycle power to individual receptacles. xCAT can support two kinds of PDUs, infrastructure PDU (irpdu) and collaborative PDU (crpdu). + +The Infrastructure rack PDUs are switched and monitored 1U PDU products which can connect up to nine C19 devices or up to 12 C13 devices and an additional three C13 peripheral devices to a signle dedicated power source. The Collaborative PDU is on the compute rack and has the 6x IEC 320-C13 receptacles that feed the rack switches. These two types of PDU have different design and implementation. xCAT has different code path to maintains PDU commands via **pdutype**. .. toctree:: diff --git a/docs/source/advanced/pdu/irpdu.rst b/docs/source/advanced/pdu/irpdu.rst index b35193b50..c7a557ed7 100644 --- a/docs/source/advanced/pdu/irpdu.rst +++ b/docs/source/advanced/pdu/irpdu.rst @@ -1,6 +1,8 @@ Infrastructure PDU ================== +Users can access Infrastructure PDU via telnet and use the **IBM PDU Configuration Utility** to set up and configure the PDU. xCAT supports PDU commands for power management and monitoring through SNMP. + PDU Commands ------------ From 179b1cdf6c9a642eafc2d53e3f9b92d7fb559ecb Mon Sep 17 00:00:00 2001 From: zet809 Date: Thu, 18 Jan 2018 13:48:13 +0800 Subject: [PATCH 15/30] modify directory to copy bmcsetup/getipmi scripts (#4649) --- build-ubunturepo | 2 +- makerpm | 2 +- xCAT-genesis-scripts/debian/rules | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index 729067680..2f9457727 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -250,7 +250,7 @@ then # shipping bmcsetup and getipmi scripts as part of postscripts files=("bmcsetup" "getipmi") for f in "${files[@]}"; do - cp ${CURDIR}/../xCAT-genesis-scripts/bin/$f ${CURDIR}/postscripts/$f + cp ${CURDIR}/../xCAT-genesis-scripts/usr/bin/$f ${CURDIR}/postscripts/$f sed -i "s/xcat.genesis.$f/$f/g" ${CURDIR}/postscripts/$f done fi diff --git a/makerpm b/makerpm index b093e116d..1e874662f 100755 --- a/makerpm +++ b/makerpm @@ -126,7 +126,7 @@ function makexcat { # shipping bmcsetup and getipmi scripts as part of postscripts files=("bmcsetup" "getipmi") for f in "${files[@]}"; do - cp "xCAT-genesis-scripts/bin/"$f ${RPMNAME}/postscripts/$f + cp "xCAT-genesis-scripts/usr/bin/"$f ${RPMNAME}/postscripts/$f sed -i "s/xcat.genesis.$f/$f/g" ${RPMNAME}/postscripts/$f done cd `dirname $0`/$RPMNAME diff --git a/xCAT-genesis-scripts/debian/rules b/xCAT-genesis-scripts/debian/rules index 6da840833..16d3fc804 100755 --- a/xCAT-genesis-scripts/debian/rules +++ b/xCAT-genesis-scripts/debian/rules @@ -33,8 +33,7 @@ install: dh_installdirs $(installdir) dh_install -X".svn" dh_install ./etc/ $(installtodir) - dh_install ./usr/bin/ $(installtodir) - dh_install ./usr/sbin/ $(installtodir) + dh_install ./usr/ $(installtodir) dh_compress dh_installdeb dh_gencontrol From df3eb6c4f48b9dd7ddc911e50065ea6df533ae11 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 18 Jan 2018 01:44:29 -0500 Subject: [PATCH 16/30] change empty_zones_enable in named.conf --- perl-xCAT/xCAT/Schema.pm | 1 + xCAT-server/lib/xcat/plugins/ddns.pm | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 02760f105..42b309c6e 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1057,6 +1057,7 @@ passed as argument rather than by table value', " requests it does not know to these servers. Note that the DNS servers on the\n" . " service nodes will ignore this value and always be configured to forward \n" . " to the management node.\n\n" . +" emptyzonesenable: (yes or no). This is to set empty-zones-enable value in named.conf options section. The default is yes. \n\n" " master: The hostname of the xCAT management node, as known by the nodes.\n\n" . " nameservers: A comma delimited list of DNS servers that each node in the cluster should\n" . " use. This value will end up in the nameserver settings of the\n" . diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 026e55bd8..f59fb1f04 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -587,6 +587,11 @@ sub process_request { $ctx->{forwarders} = \@forwarders; } + my @options = xCAT::TableUtils->get_site_attribute("emptyzonesenable"); + my $empty_zones = $options[0]; + if (defined($empty_zones) and $empty_zones =~ /^yes$|^no$/) { + $ctx->{empty_zones_enable} = $empty_zones; + } my @slave_ips; my $dns_slaves = get_dns_slave(); if (scalar @$dns_slaves) { @@ -1098,6 +1103,9 @@ sub update_namedconf { push @newnamed, "\t\t" . $_ . ";\n"; } push @newnamed, "\t};\n"; + } elsif ($ctx->{empty_zones_enable} and $line =~ /empty-zones-enable/) { + push @newnamed, "\tempty-zones-enable " . $_ . ";\n"; + $skip = 1; } elsif ($ctx->{slaves} and $line =~ /allow-transfer \{/) { push @newnamed, "\tallow-transfer \{\n"; $skip = 1; @@ -1237,6 +1245,10 @@ sub update_namedconf { push @newnamed, "\t};\n"; } + if ($ctx->{empty_zones_enable}){ + push @newnamed, "\tempty-zones-enable " . $ctx->{empty_zones_enable} . ";\n"; + } + if ($slave) { push @newnamed, "\tallow-transfer { any; };\n"; } else { From 7f7c4e4deaf28ed31f834882146ae30169af3470 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 18 Jan 2018 02:36:31 -0500 Subject: [PATCH 17/30] enhance print error message --- xCAT-server/lib/xcat/plugins/ddns.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index f59fb1f04..d2b5a9812 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -589,8 +589,14 @@ sub process_request { my @options = xCAT::TableUtils->get_site_attribute("emptyzonesenable"); my $empty_zones = $options[0]; - if (defined($empty_zones) and $empty_zones =~ /^yes$|^no$/) { - $ctx->{empty_zones_enable} = $empty_zones; + if (defined($empty_zones)) { + if ($empty_zones =~ /^yes$|^no$/) { + $ctx->{empty_zones_enable} = $empty_zones; + } else { + my $rsp; + push @{ $rsp->{data} }, "emptyzonesenable from xCAT site table should be yes or no."; + xCAT::MsgUtils->message("E", $rsp, $callback); + } } my @slave_ips; my $dns_slaves = get_dns_slave(); @@ -1104,8 +1110,7 @@ sub update_namedconf { } push @newnamed, "\t};\n"; } elsif ($ctx->{empty_zones_enable} and $line =~ /empty-zones-enable/) { - push @newnamed, "\tempty-zones-enable " . $_ . ";\n"; - $skip = 1; + push @newnamed, "\tempty-zones-enable " . $ctx->{empty_zones_enable} . ";\n"; } elsif ($ctx->{slaves} and $line =~ /allow-transfer \{/) { push @newnamed, "\tallow-transfer \{\n"; $skip = 1; From 988898dde1ee5d951fa9181e4634766194dee7e7 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 18 Jan 2018 02:58:30 -0500 Subject: [PATCH 18/30] enhance emptyzonesenable description --- perl-xCAT/xCAT/Schema.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 42b309c6e..0bb0b52d9 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1057,7 +1057,7 @@ passed as argument rather than by table value', " requests it does not know to these servers. Note that the DNS servers on the\n" . " service nodes will ignore this value and always be configured to forward \n" . " to the management node.\n\n" . -" emptyzonesenable: (yes or no). This is to set empty-zones-enable value in named.conf options section. The default is yes. \n\n" +" emptyzonesenable: (yes or no). This is to set empty-zones-enable value in named.conf options section. \n\n" " master: The hostname of the xCAT management node, as known by the nodes.\n\n" . " nameservers: A comma delimited list of DNS servers that each node in the cluster should\n" . " use. This value will end up in the nameserver settings of the\n" . From 55fed03a8166a33458d3e9f549960fe62341192c Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 18 Jan 2018 03:01:45 -0500 Subject: [PATCH 19/30] handle error --- xCAT-server/lib/xcat/plugins/ddns.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index d2b5a9812..903c3aea5 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -595,7 +595,8 @@ sub process_request { } else { my $rsp; push @{ $rsp->{data} }, "emptyzonesenable from xCAT site table should be yes or no."; - xCAT::MsgUtils->message("E", $rsp, $callback); + xCAT::MsgUtils->message("E", $rsp, $callback); + return; } } my @slave_ips; From 717b67304d63583f7c25162a61956583daf26158 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 18 Jan 2018 21:17:34 -0500 Subject: [PATCH 20/30] format emptyzonesenable --- perl-xCAT/xCAT/Schema.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 0bb0b52d9..e869078ce 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -1057,7 +1057,7 @@ passed as argument rather than by table value', " requests it does not know to these servers. Note that the DNS servers on the\n" . " service nodes will ignore this value and always be configured to forward \n" . " to the management node.\n\n" . -" emptyzonesenable: (yes or no). This is to set empty-zones-enable value in named.conf options section. \n\n" +" emptyzonesenable: (yes or no). This is to set empty-zones-enable value in named.conf options section. \n\n" . " master: The hostname of the xCAT management node, as known by the nodes.\n\n" . " nameservers: A comma delimited list of DNS servers that each node in the cluster should\n" . " use. This value will end up in the nameserver settings of the\n" . From 1fa769373ef6768e7f882e13b9d151962773eca7 Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 18 Jan 2018 21:39:38 -0500 Subject: [PATCH 21/30] work around CI failure --- travis.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/travis.pl b/travis.pl index 526cb5977..785879435 100644 --- a/travis.pl +++ b/travis.pl @@ -218,8 +218,8 @@ sub install_xcat{ my @cmds = ("cd ./../../xcat-core && sudo ./mklocalrepo.sh", "sudo chmod 777 /etc/apt/sources.list", - "sudo echo \"deb [arch=amd64] http://xcat.org/files/xcat/repos/apt/xcat-dep trusty main\" >> /etc/apt/sources.list", - "sudo echo \"deb [arch=ppc64el] http://xcat.org/files/xcat/repos/apt/xcat-dep trusty main\" >> /etc/apt/sources.list", + "sudo echo \"deb [arch=amd64] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep trusty main\" >> /etc/apt/sources.list", + "sudo echo \"deb [arch=ppc64el] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep trusty main\" >> /etc/apt/sources.list", "sudo wget -q -O - \"http://xcat.org/files/xcat/repos/apt/apt.key\" | sudo apt-key add -", "sudo apt-get -qq update"); my @output; From d9a8a1bce67e067ba53aac8f4f63560da2e4f69d Mon Sep 17 00:00:00 2001 From: bybai Date: Thu, 18 Jan 2018 22:11:46 -0500 Subject: [PATCH 22/30] fix CI failure for syslinux deb package arch --- xCATsn/debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCATsn/debian/control b/xCATsn/debian/control index 250449a81..4f2b6f223 100644 --- a/xCATsn/debian/control +++ b/xCATsn/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.9.4 Homepage: https://xcat.org/ Package: xcatsn -Architecture: all +Architecture: amd64 ppc64el Depends: ${perl:Depends}, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, libxml-parser-perl, tftpd-hpa, conserver-xcat, libnet-telnet-perl, isc-dhcp-server, apache2, nfs-kernel-server, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) Suggests: yaboot-xcat From a673a886ac53a252ec48e938cfd56e79d4d284ff Mon Sep 17 00:00:00 2001 From: bybai Date: Fri, 19 Jan 2018 00:00:03 -0500 Subject: [PATCH 23/30] fix CI xCAT-vlan failure --- build-ubunturepo | 2 +- xCAT-vlan/debian/changelog | 0 xCAT-vlan/debian/compat | 0 xCAT-vlan/debian/control | 0 xCAT-vlan/debian/copyright | 0 xCAT-vlan/debian/dirs | 0 xCAT-vlan/debian/docs | 0 xCAT-vlan/debian/install | 0 xCAT-vlan/debian/postinst | 0 9 files changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 xCAT-vlan/debian/changelog mode change 100755 => 100644 xCAT-vlan/debian/compat mode change 100755 => 100644 xCAT-vlan/debian/control mode change 100755 => 100644 xCAT-vlan/debian/copyright mode change 100755 => 100644 xCAT-vlan/debian/dirs mode change 100755 => 100644 xCAT-vlan/debian/docs mode change 100755 => 100644 xCAT-vlan/debian/install mode change 100755 => 100644 xCAT-vlan/debian/postinst diff --git a/build-ubunturepo b/build-ubunturepo index 2f9457727..7511a168d 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -213,7 +213,7 @@ then for file in $packages do file_low=`echo $file | tr '[A-Z]' '[a-z]'` - if [ "$file" = "xCAT" -o "$file" = "xCAT-genesis-scripts" ]; then + if [ "$file" = "xCAT" -o "$file" = "xCAT-genesis-scripts" -o "$file" = "xCATsn" ]; then target_archs="amd64 ppc64el" else target_archs="all" diff --git a/xCAT-vlan/debian/changelog b/xCAT-vlan/debian/changelog old mode 100755 new mode 100644 diff --git a/xCAT-vlan/debian/compat b/xCAT-vlan/debian/compat old mode 100755 new mode 100644 diff --git a/xCAT-vlan/debian/control b/xCAT-vlan/debian/control old mode 100755 new mode 100644 diff --git a/xCAT-vlan/debian/copyright b/xCAT-vlan/debian/copyright old mode 100755 new mode 100644 diff --git a/xCAT-vlan/debian/dirs b/xCAT-vlan/debian/dirs old mode 100755 new mode 100644 diff --git a/xCAT-vlan/debian/docs b/xCAT-vlan/debian/docs old mode 100755 new mode 100644 diff --git a/xCAT-vlan/debian/install b/xCAT-vlan/debian/install old mode 100755 new mode 100644 diff --git a/xCAT-vlan/debian/postinst b/xCAT-vlan/debian/postinst old mode 100755 new mode 100644 From 7633bb2714c5258883fa9695a873a8a51d016b5f Mon Sep 17 00:00:00 2001 From: chenglch Date: Fri, 19 Jan 2018 14:03:16 +0800 Subject: [PATCH 24/30] Add gocons setup doc on service node Add console state 2 in the servicenode table to help set up goconserver daemon. --- .../guides/admin-guides/references/man5/servicenode.5.rst | 2 +- perl-xCAT/xCAT/Schema.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man5/servicenode.5.rst b/docs/source/guides/admin-guides/references/man5/servicenode.5.rst index e202132f4..d4b581288 100644 --- a/docs/source/guides/admin-guides/references/man5/servicenode.5.rst +++ b/docs/source/guides/admin-guides/references/man5/servicenode.5.rst @@ -68,7 +68,7 @@ servicenode Attributes: \ **conserver**\ - Do we set up Conserver on this service node? Valid values:1 or 0. If 1, configures and starts conserver daemon. If 0, it does not change the current state of the service. + Do we set up console service on this service node? Valid values: 0, 1, or 2. If 0, it does not change the current state of the service. If 1, configures and starts conserver daemon. If 2, configures and starts goconserver daemon. diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index e869078ce..e98f51335 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -962,7 +962,7 @@ passed as argument rather than by table value', dhcpserver => 'Do we set up DHCP on this service node? Not supported on AIX. Valid values:1 or 0. If 1, runs makedhcp -n. If 0, it does not change the current state of the service. ', tftpserver => 'Do we set up TFTP on this service node? Not supported on AIX. Valid values:1 or 0. If 1, configures and starts atftp. If 0, it does not change the current state of the service. ', nfsserver => 'Do we set up file services (HTTP,FTP,or NFS) on this service node? For AIX will only setup NFS, not HTTP or FTP. Valid values:1 or 0.If 0, it does not change the current state of the service. ', - conserver => 'Do we set up Conserver on this service node? Valid values:1 or 0. If 1, configures and starts conserver daemon. If 0, it does not change the current state of the service.', + conserver => 'Do we set up console service on this service node? Valid values: 0, 1, or 2. If 0, it does not change the current state of the service. If 1, configures and starts conserver daemon. If 2, configures and starts goconserver daemon. ', monserver => 'Is this a monitoring event collection point? Valid values: 1 or 0. If 0, it does not change the current state of the service.', ldapserver => 'Do we set up ldap caching proxy on this service node? Not supported on AIX. Valid values:1 or 0. If 0, it does not change the current state of the service.', ntpserver => 'Not used. Use setupntp postscript to setup a ntp server on this service node? Valid values:1 or 0. If 0, it does not change the current state of the service.', From 589ee960e35fe0a3f3205dcbbd67565325f99395 Mon Sep 17 00:00:00 2001 From: XuWei Date: Fri, 19 Jan 2018 02:57:02 -0500 Subject: [PATCH 25/30] fix issue 4658, parameter check for rpower openbmc --- xCAT-server/lib/xcat/plugins/openbmc2.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc2.pm b/xCAT-server/lib/xcat/plugins/openbmc2.pm index 6f1bfaf99..3c59bbe0b 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc2.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc2.pm @@ -136,7 +136,7 @@ sub parse_args { my $noderange = shift; my $subcommand = undef; - if (scalar(@ARGV) != 2 and ($command =~ /rpower/)) { + if (scalar(@ARGV) != 1 and ($command =~ /rpower/)) { return ([ 1, "Only one option is supported at the same time for $command" ]); } else { $subcommand = $ARGV[0]; From 33b3161fee973923f7f62ab315e8c0ca8001d344 Mon Sep 17 00:00:00 2001 From: bybai Date: Fri, 19 Jan 2018 02:58:26 -0500 Subject: [PATCH 26/30] let agent.py can be executed --- xCAT-openbmc-py/xCAT-openbmc-py.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-openbmc-py/xCAT-openbmc-py.spec b/xCAT-openbmc-py/xCAT-openbmc-py.spec index ef722b043..43a251b8c 100644 --- a/xCAT-openbmc-py/xCAT-openbmc-py.spec +++ b/xCAT-openbmc-py/xCAT-openbmc-py.spec @@ -30,7 +30,8 @@ xCAT-openbmc-py provides openbmc related functions. rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent -install -m644 lib/python/agent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent +install -m755 lib/python/agent/agent.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent +install -m644 lib/python/agent/client.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent install -m644 lib/python/agent/xcatagent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent %ifnos linux From e2429358c41b627b10290d608f7ec0e5a3fec120 Mon Sep 17 00:00:00 2001 From: bybai Date: Fri, 19 Jan 2018 03:13:36 -0500 Subject: [PATCH 27/30] let client.py can be executed --- xCAT-openbmc-py/xCAT-openbmc-py.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xCAT-openbmc-py/xCAT-openbmc-py.spec b/xCAT-openbmc-py/xCAT-openbmc-py.spec index 43a251b8c..18bcd94ee 100644 --- a/xCAT-openbmc-py/xCAT-openbmc-py.spec +++ b/xCAT-openbmc-py/xCAT-openbmc-py.spec @@ -30,8 +30,7 @@ xCAT-openbmc-py provides openbmc related functions. rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent install -d $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent -install -m755 lib/python/agent/agent.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent -install -m644 lib/python/agent/client.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent +install -m755 lib/python/agent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent install -m644 lib/python/agent/xcatagent/*.py $RPM_BUILD_ROOT/%{prefix}/lib/python/agent/xcatagent %ifnos linux From c0074cf8ab6f6fe85faffa48a456256c37d25db7 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Fri, 19 Jan 2018 16:39:11 +0800 Subject: [PATCH 28/30] Add the 'postbooting' status to indicate xCAT start to handle postboot tasks (#4346) (#4369) - for diskful, it will be set when leaving 'booting' stage - for diskless, it will be set when leaving 'netbooting' stage - for diskful reboot, it will set when (site.runpostscript=1) - modify the document accordingly - also modify GlobalDef.pm, but it won't have impact as the status will not be in nodeset operation. --- .../guides/admin-guides/references/man5/nodelist.5.rst | 2 +- .../guides/admin-guides/references/man7/node.7.rst | 2 +- perl-xCAT/xCAT/GlobalDef.pm | 9 ++++++--- perl-xCAT/xCAT/Schema.pm | 2 +- xCAT/postscripts/xcatpostinit1.install | 9 ++++++--- xCAT/postscripts/xcatpostinit1.netboot | 4 +++- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man5/nodelist.5.rst b/docs/source/guides/admin-guides/references/man5/nodelist.5.rst index bb70e22b4..7dbe45086 100644 --- a/docs/source/guides/admin-guides/references/man5/nodelist.5.rst +++ b/docs/source/guides/admin-guides/references/man5/nodelist.5.rst @@ -50,7 +50,7 @@ nodelist Attributes: \ **status**\ - The current status of this node. This attribute will be set by xCAT software. Valid values: defined, booting, netbooting, booted, discovering, configuring, installing, alive, standingby, powering-off, unreachable. If blank, defined is assumed. The possible status change sequences are: For installation: defined->[discovering]->[configuring]->[standingby]->installing->booting->booted->[alive], For diskless deployment: defined->[discovering]->[configuring]->[standingby]->netbooting->booted->[alive], For booting: [alive/unreachable]->booting->[alive], For powering off: [alive]->powering-off->[unreachable], For monitoring: alive->unreachable. Discovering and configuring are for x Series discovery process. Alive and unreachable are set only when there is a monitoring plug-in start monitor the node status for xCAT. Note that the status values will not reflect the real node status if you change the state of the node from outside of xCAT (i.e. power off the node using HMC GUI). + The current status of this node. This attribute will be set by xCAT software. Valid values: defined, booting, netbooting, booted, discovering, configuring, installing, alive, standingby, powering-off, unreachable. If blank, defined is assumed. The possible status change sequences are: For installation: defined->[discovering]->[configuring]->[standingby]->installing->booting->[postbooting]->booted->[alive], For diskless deployment: defined->[discovering]->[configuring]->[standingby]->netbooting->[postbooting]->booted->[alive], For booting: [alive/unreachable]->booting->[postbooting]->booted->[alive], For powering off: [alive]->powering-off->[unreachable], For monitoring: alive->unreachable. Discovering and configuring are for x Series discovery process. Alive and unreachable are set only when there is a monitoring plug-in start monitor the node status for xCAT. Note that the status values will not reflect the real node status if you change the state of the node from outside of xCAT (i.e. power off the node using HMC GUI). diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst index 63d82dfa8..eb772d3b5 100644 --- a/docs/source/guides/admin-guides/references/man7/node.7.rst +++ b/docs/source/guides/admin-guides/references/man7/node.7.rst @@ -1131,7 +1131,7 @@ node Attributes: \ **status**\ (nodelist.status) - The current status of this node. This attribute will be set by xCAT software. Valid values: defined, booting, netbooting, booted, discovering, configuring, installing, alive, standingby, powering-off, unreachable. If blank, defined is assumed. The possible status change sequences are: For installation: defined->[discovering]->[configuring]->[standingby]->installing->booting->booted->[alive], For diskless deployment: defined->[discovering]->[configuring]->[standingby]->netbooting->booted->[alive], For booting: [alive/unreachable]->booting->[alive], For powering off: [alive]->powering-off->[unreachable], For monitoring: alive->unreachable. Discovering and configuring are for x Series discovery process. Alive and unreachable are set only when there is a monitoring plug-in start monitor the node status for xCAT. Note that the status values will not reflect the real node status if you change the state of the node from outside of xCAT (i.e. power off the node using HMC GUI). + The current status of this node. This attribute will be set by xCAT software. Valid values: defined, booting, netbooting, booted, discovering, configuring, installing, alive, standingby, powering-off, unreachable. If blank, defined is assumed. The possible status change sequences are: For installation: defined->[discovering]->[configuring]->[standingby]->installing->booting->[postbooting]->booted->[alive], For diskless deployment: defined->[discovering]->[configuring]->[standingby]->netbooting->[postbooting]->booted->[alive], For booting: [alive/unreachable]->booting->[postbooting]->booted->[alive], For powering off: [alive]->powering-off->[unreachable], For monitoring: alive->unreachable. Discovering and configuring are for x Series discovery process. Alive and unreachable are set only when there is a monitoring plug-in start monitor the node status for xCAT. Note that the status values will not reflect the real node status if you change the state of the node from outside of xCAT (i.e. power off the node using HMC GUI). diff --git a/perl-xCAT/xCAT/GlobalDef.pm b/perl-xCAT/xCAT/GlobalDef.pm index b9b99ea20..19cc18828 100644 --- a/perl-xCAT/xCAT/GlobalDef.pm +++ b/perl-xCAT/xCAT/GlobalDef.pm @@ -46,6 +46,7 @@ $::STATUS_INACTIVE = "unreachable"; $::STATUS_INSTALLING = "installing"; $::STATUS_INSTALLED = "installed"; $::STATUS_BOOTING = "booting"; +$::STATUS_POSTBOOTING = "postbooting"; $::STATUS_NETBOOTING = "netbooting"; $::STATUS_BOOTED = "booted"; $::STATUS_POWERING_ON = "powering-on"; @@ -66,6 +67,7 @@ $::STATUS_BMCREADY = "bmcready"; $::STATUS_INSTALLING => 1, $::STATUS_INSTALLED => 1, $::STATUS_BOOTING => 1, + $::STATUS_POSTBOOTING => 1, $::STATUS_NETBOOTING => 1, $::STATUS_BOOTED => 1, $::STATUS_POWERING_ON => 1, @@ -86,15 +88,16 @@ $::STATUS_BMCREADY = "bmcready"; $::STATUS_SYNCED => 1, ); -#defined->[discovering]->[configuring]->[standingby]->installing->[installed]->booting->alive, defined->[discovering]->[configuring]-[standingby]->netbooting->booted->alive, alive/unreachable->booting->alive, powering-off->unreachable, alive->unreachable +#defined->[discovering]->[configuring]->[standingby]->installing->[installed]->booting->[postbooting]->booted->alive, defined->[discovering]->[configuring]-[standingby]->netbooting->[postbooting]->booted->alive, alive/unreachable->booting->alive, powering-off->unreachable, alive->unreachable %::NEXT_NODESTAT_VAL = ( $::STATUS_DEFINED => { $::STATUS_DISCOVERING => 1, $::STATUS_INSTALLING => 1, $::STATUS_NETBOOTING => 1, $::STATUS_POWERING_OFF => 1, $::STATUS_POWERING_ON => 1, $::STATUS_BOOTING => 1, $::STATUS_CONFIGURING => 1 }, $::STATUS_DISCOVERING => { $::STATUS_INSTALLING => 1, $::STATUS_NETBOOTING => 1, $::STATUS_CONFIGURING => 1, $::STATUS_BOOTING => 1 }, $::STATUS_CONFIGURING => { $::STATUS_INSTALLING => 1, $::STATUS_NETBOOTING => 1, $::STATUS_STANDING_BY => 1 }, $::STATUS_INSTALLING => { $::STATUS_INSTALLED => 1, $::STATUS_BOOTING => 1 }, $::STATUS_INSTALLED => { $::STATUS_BOOTING => 1 }, - $::STATUS_BOOTING => { $::STATUS_BOOTED => 1, $::STATUS_ACTIVE => 1, $::STATUS_INACTIVE => 1 }, - $::STATUS_NETBOOTING => { $::STATUS_BOOTED => 1 }, + $::STATUS_BOOTING => { $::STATUS_BOOTED => 1, $::STATUS_ACTIVE => 1, $::STATUS_INACTIVE => 1, $::STATUS_POSTBOOTING => 1 }, + $::STATUS_POSTBOOTING => { $::STATUS_BOOTED => 1 }, + $::STATUS_NETBOOTING => { $::STATUS_POSTBOOTING => 1, $::STATUS_BOOTED => 1 }, $::STATUS_BOOTED => { $::STATUS_ACTIVE => 1, $::STATUS_INACTIVE => 1 }, $::STATUS_ACTIVE => { $::STATUS_INACTIVE => 1, $::STATUS_DISCOVERING => 1, $::STATUS_CONFIGURING => 1, $::STATUS_INSTALLING => 1, $::STATUS_NETBOOTING => 1, $::STATUS_POWERING_OFF => 1, $::STATUS_POWERING_ON => 1 }, $::STATUS_INACTIVE => { $::STATUS_ACTIVE => 1, $::STATUS_DISCOVERING => 1, $::STATUS_CONFIGURING => 1, $::STATUS_INSTALLING => 1, $::STATUS_NETBOOTING => 1, $::STATUS_POWERING_OFF => 1, $::STATUS_POWERING_ON => 1 }, diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 487ab0ac2..76eada918 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -624,7 +624,7 @@ passed as argument rather than by table value', descriptions => { node => 'The hostname of a node in the cluster.', groups => "A comma-delimited list of groups this node is a member of. Group names are arbitrary, except all nodes should be part of the 'all' group. Internal group names are designated by using __. For example, __Unmanaged, could be the internal name for a group of nodes that is not managed by xCAT. Admins should avoid using the __ characters when defining their groups.", - status => 'The current status of this node. This attribute will be set by xCAT software. Valid values: defined, booting, netbooting, booted, discovering, configuring, installing, alive, standingby, powering-off, unreachable. If blank, defined is assumed. The possible status change sequences are: For installation: defined->[discovering]->[configuring]->[standingby]->installing->booting->booted->[alive], For diskless deployment: defined->[discovering]->[configuring]->[standingby]->netbooting->booted->[alive], For booting: [alive/unreachable]->booting->[alive], For powering off: [alive]->powering-off->[unreachable], For monitoring: alive->unreachable. Discovering and configuring are for x Series discovery process. Alive and unreachable are set only when there is a monitoring plug-in start monitor the node status for xCAT. Note that the status values will not reflect the real node status if you change the state of the node from outside of xCAT (i.e. power off the node using HMC GUI).', + status => 'The current status of this node. This attribute will be set by xCAT software. Valid values: defined, booting, netbooting, booted, discovering, configuring, installing, alive, standingby, powering-off, unreachable. If blank, defined is assumed. The possible status change sequences are: For installation: defined->[discovering]->[configuring]->[standingby]->installing->booting->[postbooting]->booted->[alive], For diskless deployment: defined->[discovering]->[configuring]->[standingby]->netbooting->[postbooting]->booted->[alive], For booting: [alive/unreachable]->booting->[postbooting]->booted->[alive], For powering off: [alive]->powering-off->[unreachable], For monitoring: alive->unreachable. Discovering and configuring are for x Series discovery process. Alive and unreachable are set only when there is a monitoring plug-in start monitor the node status for xCAT. Note that the status values will not reflect the real node status if you change the state of the node from outside of xCAT (i.e. power off the node using HMC GUI).', statustime => "The data and time when the status was updated.", appstatus => "A comma-delimited list of application status. For example: 'sshd=up,ftp=down,ll=down'", appstatustime => 'The date and time when appstatus was updated.', diff --git a/xCAT/postscripts/xcatpostinit1.install b/xCAT/postscripts/xcatpostinit1.install index 96fd3f72e..21bf77392 100755 --- a/xCAT/postscripts/xcatpostinit1.install +++ b/xCAT/postscripts/xcatpostinit1.install @@ -28,7 +28,7 @@ fi case $1 in stop) - [ "$NODESTATUS" != "n" ] && /xcatpost/updateflag.awk $XCATSERVER 3002 "installstatus powering-off" + [ "$NODESTATUS" != "n" ] && /xcatpost/updateflag.awk $XCATSERVER 3002 "installstatus powering-off" ;; start) # check for the REBOOT specified in xcatinfo to run post boot scripts on reboot @@ -37,11 +37,14 @@ start) fi # if the xcatdsklspost file exists and this is a reboot - run xcatdsklspost with a mode of 6 if [ "$REBOOT" = "TRUE" -a -r /opt/xcat/xcatdsklspost ] && [[ "$RUNBOOTSCRIPTS" =~ ^(1|yes|y)$ ]]; then + [ "$NODESTATUS" != "n" ] && /xcatpost/updateflag.awk $XCATSERVER 3002 "installstatus postbooting" + # xcatdsklspost will set the status to 'booted' or 'failed' /opt/xcat/xcatdsklspost 6 elif [ "$REBOOT" = "TRUE" ] && [[ "$NODESTATUS" =~ ^(1|yes|y)$ ]]; then - /xcatpost/updateflag.awk $XCATSERVER 3002 "installstatus booted" + /xcatpost/updateflag.awk $XCATSERVER 3002 "installstatus booted" else - # run /opt/xcat/xcatinstallpost + [ "$NODESTATUS" != "n" ] && /xcatpost/updateflag.awk $XCATSERVER 3002 "installstatus postbooting" + # run /opt/xcat/xcatinstallpost, it will set the status to 'booted' or 'failed' if [ -r /opt/xcat/xcatinstallpost ]; then /opt/xcat/xcatinstallpost fi diff --git a/xCAT/postscripts/xcatpostinit1.netboot b/xCAT/postscripts/xcatpostinit1.netboot index 099c0b725..f21ba9c73 100755 --- a/xCAT/postscripts/xcatpostinit1.netboot +++ b/xCAT/postscripts/xcatpostinit1.netboot @@ -34,7 +34,7 @@ status) stop) echo -n "nothing to stop " logger -t xcat -p local4.info "nothing to stop" - grep nonodestatus /proc/cmdline 2>/dev/null || [ -n "$XCATSERVER" ] && /xcatpost/updateflag.awk $XCATSERVER 3002 "installstatus powering-off" + grep nonodestatus /proc/cmdline 2>/dev/null || [ -n "$XCATSERVER" ] && /xcatpost/updateflag.awk $XCATSERVER 3002 "installstatus powering-off" ;; start) # Node is stateless by default @@ -56,10 +56,12 @@ start) # Test for script existance if ! [ -x "$SCRIPT" ]; then msg "can't locate executable $SCRIPT" + grep nonodestatus /proc/cmdline 2>/dev/null || [ -n "$XCATSERVER" ] && /xcatpost/updateflag.awk $XCATSERVER 3002 "installstatus failed" exit -1 fi # Run $SCRIPT according to node type + grep nonodestatus /proc/cmdline 2>/dev/null || [ -n "$XCATSERVER" ] && /xcatpost/updateflag.awk $XCATSERVER 3002 "installstatus postbooting" if [ $STATELITE -ne 0 ]; then logger -t xcat -p local4.info "Call $SCRIPT for statelite mode" "$SCRIPT" 4 From e354ffc897c567ddb7deea6bca0b41d918b71ec0 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Mon, 22 Jan 2018 12:41:05 +0800 Subject: [PATCH 29/30] Fix clean install problem of xcat-genesis-base --- xCAT-genesis-builder/debuild-xcat-genesis-base | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xCAT-genesis-builder/debuild-xcat-genesis-base b/xCAT-genesis-builder/debuild-xcat-genesis-base index d6e029345..7ec4109d0 100755 --- a/xCAT-genesis-builder/debuild-xcat-genesis-base +++ b/xCAT-genesis-builder/debuild-xcat-genesis-base @@ -17,6 +17,8 @@ set -x [ -n "${RPM_PACKAGE}" ] || exit 1 [ -f "${RPM_PACKAGE}" ] || exit 1 +umask 0022 + EXTRACT_DIR="${RPM_PACKAGE##*/}" EXTRACT_DIR="${EXTRACT_DIR%%-snap*}" @@ -39,7 +41,7 @@ fi sed -i -e "/^Description:/i Breaks: xcat-genesis-scripts-${PACKAGE_ARCH//x86_64/amd64} (<< 2.13.10)" "${EXTRACT_DIR}/debian/control" -cat >"${EXTRACT_DIR}/debian/preinst" <<-EOF +cat >"${EXTRACT_DIR}/debian/preinst" <"${EXTRACT_DIR}/debian/preinst" <<-EOF rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/lib64 [ -d /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/var/run ] && rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/var/run + +exit 0 EOF +chmod 0755 "${EXTRACT_DIR}/debian/preinst" + ( cd "${EXTRACT_DIR}" && debian/rules binary ) From 08a3bb11e27272feef33536280333e089ae8a217 Mon Sep 17 00:00:00 2001 From: bybai Date: Mon, 22 Jan 2018 00:02:51 -0500 Subject: [PATCH 30/30] fix buildpythonrpm --- makepythonrpm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makepythonrpm b/makepythonrpm index 72527f512..4ee5b60b7 100755 --- a/makepythonrpm +++ b/makepythonrpm @@ -22,7 +22,7 @@ VER=`cat Version` REL="--define" EASE='usedate 1' RPMROOT=/root/rpmbuild - +mkdir -p $RPMROOT/SOURCES rpmbuild --version > /dev/null if [ $? -gt 0 ]; then echo "Error: rpmbuild does not appear to be installed or working."