From 6f4c59fece2b3c62d182557bf13d7894fafe7e77 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 10 Sep 2020 14:23:33 -0400 Subject: [PATCH] Verify nbk kernel file is present before defaulting to use it --- docs/source/advanced/hierarchy/define_service_nodes.rst | 6 ++++-- xCAT-server/lib/xcat/plugins/destiny.pm | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/source/advanced/hierarchy/define_service_nodes.rst b/docs/source/advanced/hierarchy/define_service_nodes.rst index 259a748a0..8b13f99df 100644 --- a/docs/source/advanced/hierarchy/define_service_nodes.rst +++ b/docs/source/advanced/hierarchy/define_service_nodes.rst @@ -103,5 +103,7 @@ The following table illustrates the cluster being used in this example: chdef -t site clustersite installloc= rsync -auv --exclude 'autoinst' /install r1n01:/ rsync -auv --exclude 'autoinst' /install r2n01:/ - rsync -auv --exclude 'autoinst' /tftpboot r1n01:/ - rsync -auv --exclude 'autoinst' /tftpboot r2n01:/ + rsync -auv /tftpboot r1n01:/ + rsync -auv /tftpboot r2n01:/ + +.. note:: If ``/install`` and ``/tftpboot`` directories local to each Service Node are used and ``mknb`` command is executed to generate a diskless network boot image with custom changes, it will not be automatically copied to the Service Node. Make sure to run the above ``rsync`` commands after executing the ``mknb``. Verify ``/tftpboot/xcat`` directory on Service node contains ``genesis.kernel.`` and ``genesis.fs..gz`` files. diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index f194bfd64..2832d7710 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -711,10 +711,16 @@ sub setdestiny { $bphash->{$_}->[0]->{initrd} = "xcat/genesis.fs.$arch.$othersuffix"; $bphash->{$_}->[0]->{kcmdline} = $kcmdline . "xcatd=$master:$xcatdport destiny=$state"; } - } else { #'legacy' environment + } else { # genesis.kernel file is not there, assume 'legacy' environment + if (-r "$tftpdir/xcat/nbk.$arch") { $bphash->{$_}->[0]->{kernel} = "xcat/nbk.$arch"; $bphash->{$_}->[0]->{initrd} = "xcat/nkfs.$arch.gz"; $bphash->{$_}->[0]->{kcmdline} = $kcmdline . "xcatd=$master:$xcatdport"; + $callback->({ warning => ["No genesis.kernel.$arch file found. Defaulting to legacy nbk.$arch"]}); + } else { # can not find genesis.kernel or nbk file + $callback->({ error => ["Could not find genesis.kernel.$arch or legacy nbk.$arch files"], errorcode => [1] }); + exit(1); + } } }