xcat2 / xcat-docker

Repository to build Docker image for xCAT
5 stars 5 forks source link

"xcatprobe -l" failed to load switch_macmap due to the /opt/xcat/probe/subcmds/bin direcotry is empty. Something went wrong when xcat package #13

Closed hu-weihua closed 5 years ago

hu-weihua commented 5 years ago

xcatprobe -l failed to load switch_macmap due to the /opt/xcat/probe/subcmds/bin direcotry is empty. Something went wrong when xCAT Docker image build.

[root@c910f03c17k19 subcmds]# ll
total 244
drwxr-xr-x 2 root root     6 Apr  3 07:36 bin
-rwxr-xr-x 4 root root 10530 Mar 29 07:19 clusterstatus
-rwxr-xr-x 4 root root  8847 Mar 29 07:19 code_template
-rwxr-xr-x 4 root root 11387 Mar 29 07:19 detect_dhcpd
-rwxr-xr-x 4 root root 64928 Mar 29 07:19 discovery
-rwxr-xr-x 4 root root 15720 Mar 29 07:19 image
-rwxr-xr-x 4 root root  7316 Mar 29 07:19 nodecheck
-rwxr-xr-x 4 root root 56222 Mar 29 07:19 osdeploy
-rwxr-xr-x 4 root root  8943 Mar 29 07:19 osimagecheck
-rwxr-xr-x 4 root root  3612 Mar 29 07:19 switch_macmap
-rwxr-xr-x 4 root root 48785 Mar 29 07:19 xcatmn

[root@c910f03c17k19 subcmds]# xcatprobe  -l
Supported sub commands are:
detect_dhcpd     detect_dhcpd can be used to detect the dhcp server in a network for a specific mac address. Before
                 using this command, install 'tcpdump' command. The operating system supported are RedHat, SLES and
                 Ubuntu.
osdeploy         Probe operating system provision process. Supports two modes - 'Realtime monitor' and 'Replay history'.
nodecheck        Use this command to check node defintions in xCAT DB.
xcatmn           After xcat installation, use this command to check if xcat has been installed correctly and is ready
                 for use. Before using this command, install 'tftp', 'nslookup' and 'wget' commands. Supported platforms
                 are RedHat, SLES and Ubuntu.
osimagecheck     Use this command to check osimage defintions in xCAT DB.
discovery        Probe for discovery process, including pre-check for required configuration and realtime monitor of
                 discovery process.
image            Use this command to check if specified diskless nodes have the same images installed or if nodes are
                 installed with the same image as defined on the management node.
clusterstatus    Use this command to get node summary in the cluster.
code_template    This isn't a probe tool, this is just a template for sub command coding. Using it to develop sub
                 command which need to cover hierarchical cluster

[root@c910f03c17k19 subcmds]# xcatprobe  -V
Starting to load sub command form ~/subcmds.............
.....
-->/opt/xcat/probe//subcmds/switch_macmap
[OUTPUT]:
[failed] :No 'switchprobe' tool is available at /opt/xcat/probe/subcmds/bin/
skip /opt/xcat/probe//subcmds/switch_macmap for doing '/opt/xcat/probe//subcmds/switch_macmap -T' failed, invalid flag

[root@c910f03c17k19 subcmds]# cd bin
[root@c910f03c17k19 bin]# ll
total 0

# cat xcat-core/xCAT-probe/xCAT-probe.spec 
.....
%post
if [ -e %{prefix}/probe/subcmds/bin/switchprobe ]; then
    rm -rf %{prefix}/probe/subcmds/bin/switchprobe
else
    mkdir -p %{prefix}/probe/subcmds/bin/
fi
cd %{prefix}/probe/subcmds/bin/
if [ -e %{prefix}/bin/xcatclient ]; then
    ln -s %{prefix}/bin/xcatclient switchprobe
fi
.......
robin2008 commented 5 years ago

This might be related to https://github.com/xcat2/xcat-core/issues/6026 But I checked that the xCAT-client is already requires by xCAT-probe, so there is still issue in the spec to build docker container.

robin2008 commented 5 years ago

Plan to workaround it when starting container. ln -sf /opt/xcat/bin/xcatclient /opt/xcat/probe/subcmds/bin/switchprobe

robin2008 commented 5 years ago

It is fixed in https://github.com/xcat2/xcat-docker/pull/14

robin2008 commented 5 years ago

please verify it with xcat/xcat2:latest

robin2008 commented 5 years ago

UT:

xcatprobe -l
Supported sub commands are:
detect_dhcpd     detect_dhcpd can be used to detect the dhcp server in a network for a specific mac address. Before
                 using this command, install 'tcpdump' command. The operating system supported are RedHat, SLES and
                 Ubuntu.
osdeploy         Probe operating system provision process. Supports two modes - 'Realtime monitor' and 'Replay history'.
nodecheck        Use this command to check node defintions in xCAT DB.
xcatmn           After xcat installation, use this command to check if xcat has been installed correctly and is ready
                 for use. Before using this command, install 'tftp', 'nslookup' and 'wget' commands. Supported platforms
                 are RedHat, SLES and Ubuntu.
osimagecheck     Use this command to check osimage defintions in xCAT DB.
discovery        Probe for discovery process, including pre-check for required configuration and realtime monitor of
                 discovery process.
image            Use this command to check if specified diskless nodes have the same images installed or if nodes are
                 installed with the same image as defined on the management node.
clusterstatus    Use this command to get node summary in the cluster.
switch_macmap    To retrieve MAC address mapping for the specified switch, or all the switches defined in 'switches'
                 table in xCAT db. Currently, this command does not support hierarchy.
code_template    This isn't a probe tool, this is just a template for sub command coding. Using it to develop sub
                 command which need to cover hierarchical cluster
hu-weihua commented 5 years ago

Have been verified in new xCAT container image

Supported sub commands are:
detect_dhcpd     detect_dhcpd can be used to detect the dhcp server in a network for a specific mac address. Before
                 using this command, install 'tcpdump' command. The operating system supported are RedHat, SLES and
                 Ubuntu.
osdeploy         Probe operating system provision process. Supports two modes - 'Realtime monitor' and 'Replay history'.
nodecheck        Use this command to check node defintions in xCAT DB.
xcatmn           After xcat installation, use this command to check if xcat has been installed correctly and is ready
                 for use. Before using this command, install 'tftp', 'nslookup' and 'wget' commands. Supported platforms
                 are RedHat, SLES and Ubuntu.
osimagecheck     Use this command to check osimage defintions in xCAT DB.
discovery        Probe for discovery process, including pre-check for required configuration and realtime monitor of
                 discovery process.
image            Use this command to check if specified diskless nodes have the same images installed or if nodes are
                 installed with the same image as defined on the management node.
clusterstatus    Use this command to get node summary in the cluster.
switch_macmap    To retrieve MAC address mapping for the specified switch, or all the switches defined in 'switches'
                 table in xCAT db. Currently, this command does not support hierarchy.
code_template    This isn't a probe tool, this is just a template for sub command coding. Using it to develop sub
                 command which need to cover hierarchical cluster
[root@c910f03c09k03 ~]# ll /opt/xcat/probe/subcmds/
total 244
drwxr-xr-x 1 root root    25 Apr 21 18:38 bin
-rwxr-xr-x 4 root root 10530 Mar 29 07:19 clusterstatus
-rwxr-xr-x 4 root root  8847 Mar 29 07:19 code_template
-rwxr-xr-x 4 root root 11387 Mar 29 07:19 detect_dhcpd
-rwxr-xr-x 4 root root 64928 Mar 29 07:19 discovery
-rwxr-xr-x 4 root root 15720 Mar 29 07:19 image
-rwxr-xr-x 4 root root  7316 Mar 29 07:19 nodecheck
-rwxr-xr-x 4 root root 56222 Mar 29 07:19 osdeploy
-rwxr-xr-x 4 root root  8943 Mar 29 07:19 osimagecheck
-rwxr-xr-x 4 root root  3612 Mar 29 07:19 switch_macmap
-rwxr-xr-x 4 root root 48785 Mar 29 07:19 xcatmn