﻿1 add

   add 可将基准或节点添加到当前会话的当前工作集
   。

      ---------------------------------------------------------------------   
    注意： 在添加 ftp 类型基准之前，请在 setattributes 命令中添加        
    hp-passport-token 参数。 执行 getbaselines 命令， 
    以查看可用 SPP 基准的列表。 有关 setattributes 的详细信息，           
    请参阅 ???setattributes 帮助文件。                        
                                                                              
    hpsum getbaselines --list hp.com                                          
                                                                              
    HP SUM 将返回在线可用基准的列表，例如：         
                                                                              
    Web 基准信息：                                                 
    1. 名称： HP Service Pack for ProLiant                                     
                    软件包文件名： spp.2014.02.0.B                         
                    版本： 2014.02.0.B                                      
                    发行日期： 2014 年 4 月 25 日                                  
    2. 名称： HP Service Pack for ProLiant                                     
                    软件包文件名： spp.2013.09.0.C                         
                    版本： 2013.09.0.C                                      
                    发行日期： 2014 年 4 月 30 日                                  
      ---------------------------------------------------------------------   

   您可以为列表开头的所有节点或基准
   提供密码。

   例如，hpsum add [--nodes n1 [type=<node_type>] [user=<username>]
   [password=<userpassword>] [su_user=<su_user>]
   [su_password=<suuser_password>] [use_sudo=true]
   [switch_username=<Moonshot_switchA_username>]
   [switch_password=<Moonshot_switchA_password>]
   [switch_enable=<Moonshot_switchA_enable>]

   --baselines b1 [save_location=<directory>] [type=<baseline_type]

      ---------------------------------------------------------------------   
    注意： HP SUM iCLI 模式不会自动添加节点或基准。 交 
    互式 CLI 模式不会自动添加关联节点。 使用 GUI 
    模式添加关联设备。                                           
      ---------------------------------------------------------------------   

   如果添加 VC 节点，请包括以下属性： oa_username 和
   oa_password。

  1.1 语法

   hpsum add --nodes n1 [type=<node_type>] user=<username>
   password=<userpassword>]

   hpsum add --baselines b1 [save_location=<directory>] [type
   <baseline_type>]

   add /baselines type=unc "\\UNC_PATH" unc_username=user unc_password=pwd

      ---------------------------------------------------------------------   
    注意： 不要在相同的命令中将基准作为节点添加。 请使用两个单独的 
    命令。                                                                 
      ---------------------------------------------------------------------   

  1.2 参数

   add 命令提供了以下选项：

   +------------------------------------------------------------------------+
   | 参数                                   | 说明                          |
   |----------------------------------------+-------------------------------|
   | hpsum                                  | HP SUM  脚本启动              |
   |                                        | 此操作。                      |
   |----------------------------------------+-------------------------------|
   |                                        | 该命令添加节点或              |
   | add                                    | 基准到 HP SUM                 |
   |                                        | 会话。                        |
   |----------------------------------------+-------------------------------|
   |                                        | 要执行添加操作的              |
   |                                        | 对象。    列表中的项目        |
   |                                        | 应由空格                      |
   |                                        | 隔开。 您可以在全局范围内     |
   |                                        | 为所有节点指定用户。          |
   |                                        |                               |
   |                                        |                               |
   |                                        | domain_name localhost         |
   |                                        |                               |
   | --nodes <nodeslist>                    | IP： 127.0.0.1                |
   |                                        |                               |
   |                                        | ipv6： ::1                    |
   |                                        |                               |
   |                                        | 添加节点或                    |
   |                                        | 基准。 不在相同命令中         |
   |                                        | 同时添加这两者。              |
   |                                        |                               |
   |                                        | 如果要添加 VC 节点，          |
   |                                        | 使用 Enet 模块的 IP           |
   |                                        | 地址。                        |
   |----------------------------------------+-------------------------------|
   |                                        | 此参数定义                    |
   |                                        | 节点类型。 HP SUM 支持以下    |
   |                                        | 节点类型：                    |
   |                                        |                               |
   |                                        | windows                       |
   |                                        |                               |
   |                                        | linux                         |
   |                                        |                               |
   |                                        | ilo                           |
   |                                        |                               |
   |                                        | virtual_connect-Use IP        |
   |                                        | 主 Enet 模块的                |
   |                                        | 地址。 VC 节点需要            |
   |                                        | oa_user 和 oa_password。      |
   |                                        |                               |
   | type = <node type>                     | oa                            |
   |                                        |                               |
   |                                        | vmware                        |
   |                                        |                               |
   |                                        | hpux                          |
   |                                        |                               |
   |                                        |                               |
   |                                        |                               |
   |                                        | sas_switch                    |
   |                                        |                               |
   |                                        | fc_switch                     |
   |                                        |                               |
   |                                        | sd2                           |
   |                                        |                               |
   |                                        | moonshot                      |
   |                                        |                               |
   |                                        | 未知                          |
   |----------------------------------------+-------------------------------|
   | user=<user_name>                       | 这是节点的                    |
   |                                        | 用户名凭据。                  |
   | 例如： user=john_doe@example.com       |                               |
   |----------------------------------------+-------------------------------|
   |                                        | 节点的用户                    |
   | password=<password>                    | 密码凭据。 如果未             |
   |                                        | 在命令行中                    |
   | 例如： password=userpassword           |输入此项，HP SUM 会提示        |
   |                                        | 输入密码。                    |
   |----------------------------------------+-------------------------------|
   | su_user=<super_userID>                 |                               |
   |                                        | super 用户的用户              |
   | 例如：                                 | 名。                          |
   | user=su_john_doe@example.com           |                               |
   |----------------------------------------+-------------------------------|
   | su_password=<super_user_password>      | super 用户的                  |
   |                                        | 密码 。                       |
   | 例如： password=su_userpassword        |                               |
   |----------------------------------------+-------------------------------|
   |                                        | 使用凭据作为 sudo             |
   |                                        | 凭据。                        |
   |                                        |                               |
   | use_sudo                               |可能的选项：                   |
   |                                        |                               |
   |                                        |   o true                      |
   |                                        |                               |
   |                                        |   o false                     |
   |----------------------------------------+-------------------------------|
   |                                        | Moonshot 交换机 A             |
   |                                        | 的用户名。如果交换机 B        |
   |                                        | 的用户名和交换机 A            |
   |                                        | 的用户名相同，则此值对        |
   |                                        | 两个交换机都适用。            |
   | switch_username=<switch_a_username>    |                               |
   |                                        |    ------------------------   |
   |                                        |  注意： 您可以使用            |
   |                                        |  setattributes 命令指定       |
   |                                        |  交换机 B 凭据。              |
   |                                        |    ------------------------   |
   |----------------------------------------+-------------------------------|
   |                                        | Moonshot 交换机 A             |
   |                                        | 的密码。如果交换机 B 的       |
   |                                        | 的用户名和交换机 A            |
   |                                        | 的用户名相同，则此值对        |
   |                                        | 两个交换机都适用。            |
   | switch_password=<switch_a_password>    |                               |
   |                                        |    ------------------------   |
   |                                        |  注意： 您可以使用            |
   |                                        |  setattributes 命令指定       |
   |                                        |  交换机 B 凭据。              |
   |                                        |    ------------------------   |
   |----------------------------------------+-------------------------------|
   | switch_enable=<enable_password>        | 为 Moonshot 节点              |
   |                                        | 启用交换机 A。                |
   |----------------------------------------+-------------------------------|
   |vcenter_host                            |使用这些参数                   |
   |                                        | 与锁定模式下的                |
   | vcenter_username                       | VMware 主机                   |
   |                                        | 建立连接。                    |
   | vcenter_password                       |                               |
   |----------------------------------------+-------------------------------|
   |                                        | 可能的选项：                  |
   |                                        |                               |
   | --use_sshkey                           |   o true                      |
   |                                        |                               |
   |                                        |   o false                     |
   |----------------------------------------+-------------------------------|
   |                                        | 为私钥                        |
   | privatekeyfile                         | 输入地址。 私钥               |
   |                                        | 必须采用 PEM 格式。           |
   |----------------------------------------+-------------------------------|
   |                                        | （可选）输入私钥的            |
   | passphrase                             | 密                            |
   |                                        | 码。                          |
   |----------------------------------------+-------------------------------|
   |                                        | 使用此参数通过                |
   |                                        | 指定目录添加                  |
   | --baselines                            | 本地基准。 如果您             |
   |                                        | 添加 FTP 或 HTTP              |
   |                                        | 基准，请使用                  |
   |                                        | save_location 参数。          |
   |----------------------------------------+-------------------------------|
   | save_location=<working_location>       | 您希望在其中                  |
   |                                        | 保存已下载的基准的目录。      |
   |----------------------------------------+-------------------------------|
   |                                        | 此参数定义                    |
   |                                        | 基准类型。 HP SUM             |
   |                                        | 支持以下基准类型：            |
   |                                        |                               |
   |                                        | http                          |
   |                                        |                               |
   |                                        | ftp                           |
   | 类型                                   |                               |
   |                                        | unc（仅限 Windows）           |
   |                                        |                               |
   |                                        |    ------------------------   |
   |                                        |  注意： 确保 UNC              |
   |                                        |  目录未在本地主机             |
   |                                        |  系统中打开。                 |
   |                                        |    ------------------------   |
   |----------------------------------------+-------------------------------|
   |                                        | 为 UNC 目录路径               |
   | unc_username=<unc_username>            | 输入用户名。 只对             |
   |                                        | Windows 有效。                |
   |----------------------------------------+-------------------------------|
   |                                        | 为 UNC 目录路径               |
   | unc_password=<unc_password>            | 输入密码。 只对               |
   |                                        | Windows 有效。                |
   |----------------------------------------+-------------------------------|
   |                                        | 这是您要添加的                |
   |                                        | 捆绑文件的名称。使用          |
   | bundle                                 | 命令 getbaselines /list 以    |
   |                                        | 显示捆绑文件名称的            |
   |                                        | 列表。 例如，                 |
   |                                        | bundle=spp.2014.04.0.B。      |
   |----------------------------------------+-------------------------------|
   |                                        |（仅适用于 HTTP 基准）该       |
   |                                        | 属性允许您基于                |
   |                                        | 操作系统过滤 HP SUM           |
   |                                        | 下载的组件。                  |
   |                                        | 有效选项                      |
   |                                        | 包括：                        |
   | filter_os                              |                               |
   |                                        |   o windows                   |
   |                                        |                               |
   |                                        |   o linux                     |
   |                                        |                               |
   |                                        |   o vmware                    |
   |                                        |                               |
   |                                        |   o hpux                      |
   +------------------------------------------------------------------------+

  1.3 返回代码

   +------------------------------------------------------------------------+
   | 返回代码               | Windows | Linux | 文本                        |
   |------------------------+---------+-------+-----------------------------|
   | SUCCESS_NO_REBOOT      | 0       | 0     | 命令成功。                  |
   |------------------------+---------+-------+-----------------------------|
   |                        |         |       | 已成功完成该命令，          |
   |                        |         |       | 但不需要执行该命令，        |
   |                        |         |       | 或者所有内容                |
   |                        |         |       | 已处于最新状态。            |
   | SUCCESS_NOT_REQUIRED   | 3       | 3     |                             |
   |                        |         |       |    ----------------------   |
   |                        |         |       |  注意： 节点或基准          |
   |                        |         |       |  已存在。                   |
   |                        |         |       |    ----------------------   |
   |------------------------+---------+-------+-----------------------------|
   | FAILURE_GENERAL        | -1      | 255   | 出现了常规错误。            |
   |                        |         |       | 有关详细信息，请参阅日志。  |
   |------------------------+---------+-------+-----------------------------|
   |                        |         |       | 遇到了错误的输入            |
   | FAILURE_BAD_PARM       | -2      | 254   | 参数。 有关详细信息，       |
   |                        |         |       | 请参阅日志。                |
   |------------------------+---------+-------+-----------------------------|
   | FAILURE_COMMAND_FAILED | -4      | 253   | 命令失败。 有关             |
   |                        |         |       | 详细信息，请参阅日志。      |
   +------------------------------------------------------------------------+

  1.4 示例

    Windows 示例命令行

   C:\>hpsum add /nodes 10.0.1.15 type=windows

   C:\>hpsum add /baselines type=ftp save_location=c:\temp\pfw
   bundle=spp.2014.02.0.B

   hpsum add /nodes type=vc 15.154.117.94 user=Administrator
   password=12iso*help oa_username=Administrator oa_password=12iso*help

    Linux 示例命令行

   $ ./hpsum add --nodes 10.0.1.16 type=linux

   $ ./hpsum add --baselines "/SPP/" "/tmp/myrepos/"

   $ ./hpsum add --baselines type=ftp save_location="/tmp/pfw
   bundle=spp.2014.02.0.B

   $ ./hpsum add --nodes type=vc 15.154.117.94 user=Administrator
   password=12iso*help oa_username=Administrator oa_password=12iso*help

   $ ./hpsum add --nodes 15.212.143.4 type=vmware vcenter_host=15.212.143.112 
   vcenter_username=Administrator vcenter_password=12iso*help
      ---------------------------------------------------------------------   
    注意： 如果节点类型为 Linux 或 HP-UX，则可以使用 su_user 和         
    su_password 或使用 use_sudo。                                             
                                                                              
    例如：                                                              
                                                                              
    hpsum add /nodes 192.168.1.1 type=Linux user=user password=password       
    su_user=user1 su_password=password1                                       
                                                                              
    hpsum add /nodes 192.168.1.1 type=Linux user=user password=password       
    use_sudo=true                                                             
      ---------------------------------------------------------------------   
