IBM Cloud infrastructure cli错误 - 未实现setUserMetadata

时间:2018-06-06 05:12:23

标签: ibm-cloud-infrastructure

我正在https://console.bluemix.net/docs/cli/reference/softlayer/index.html#sl_vs_create关注IBM Cloud infrastructure(ibmcloud sl)cli文档以创建新的虚拟服务器。我使用的是最新版本0.7.0。

我想从文件中读取userdata,所以我尝试了-F和--userfile选项。

两个选项都给我同样的错误

  

" SoftLayer_Virtual_Guest_Strategy_Behavior_Standard :: setUserMetadata   没有实施。 (HTTP 500)"。

以下是完整的输入和输出:

rails _5.1.0_ new test1

有人有这个工作吗?感谢。

1 个答案:

答案 0 :(得分:0)

默认情况下, ibmcloud sl 使用SoftLayer端点https://api.softlayer.com/rest/v3.1执行API调用,请参阅此处https://console.bluemix.net/docs/cli/reference/softlayer/index.html#sl_init

似乎 ibmcloud sl 存在问题,因为正在调用的服务和方法不存在:

  

SoftLayer_Virtual_Guest_Strategy_Behavior_Standard :: setUserMetadata

SoftLayer API中的可用服务和数据类型列于此处https://softlayer.github.io/reference/softlayerapi/

作为建议,您可以尝试使用SoftLayer开发人员提供的名为SLCLI的CLI命令,您可以在此处找到文档:

https://softlayer-python.readthedocs.io/en/latest/cli/vs.html

https://github.com/softlayer/softlayer-python

Bellow是您在创建虚拟客户时可以使用的选项:

$slcli virtual create --help

Usage: slcli virtual create [OPTIONS]

  Order/create virtual servers.

Options:
  -H, --hostname TEXT             Host portion of the FQDN  [required]
  -D, --domain TEXT               Domain portion of the FQDN  [required]
  -c, --cpu INTEGER               Number of CPU cores (not available with
                                  flavors)
  -m, --memory INTEGER            Memory in mebibytes (not available with
                                  flavors)
  -f, --flavor TEXT               Public Virtual Server flavor key name
  -d, --datacenter TEXT           Datacenter shortname  [required]
  -o, --os TEXT                   OS install code. Tip: you can specify
                                  <OS>_LATEST
  --image TEXT                    Image ID. See: 'slcli image list' for
                                  reference
  --boot-mode TEXT                Specify the mode to boot the OS in.
                                  Supported modes are HVM and PV.
  --billing [hourly|monthly]      Billing rate  [default: hourly]
  --dedicated / --public          Create a Dedicated Virtual Server
  --host-id INTEGER               Host Id to provision a Dedicated Host
                                  Virtual Server onto
  --san                           Use SAN storage instead of local disk.
  --test                          Do not actually create the virtual server
  --export PATH                   Exports options to a template file
  -i, --postinstall TEXT          Post-install script to download
  -k, --key TEXT                  SSH keys to add to the root user (multiple
                                  occurrence permitted)
  --disk TEXT                     Disk sizes (multiple occurrence permitted)
  --private                       Forces the VS to only have access the
                                  private network
  --like TEXT                     Use the configuration from an existing VS
  -n, --network TEXT              Network port speed in Mbps
  -g, --tag TEXT                  Tags to add to the instance (multiple
                                  occurrence permitted)
  -t, --template PATH             A template file that defaults the command-
                                  line options
  -u, --userdata TEXT             User defined metadata string
  -F, --userfile PATH             Read userdata from file
  --vlan-public INTEGER           The ID of the public VLAN on which you want
                                  the virtual server placed
  --vlan-private INTEGER          The ID of the private VLAN on which you want
                                  the virtual server placed
  -S, --public-security-group TEXT
                                  Security group ID to associate with the
                                  public interface (multiple occurrence
                                  permitted)
  -s, --private-security-group TEXT
                                  Security group ID to associate with the
                                  private interface (multiple occurrence
                                  permitted)
  --wait INTEGER                  Wait until VS is finished provisioning for
                                  up to X seconds before returning
  -h, --help                      Show this message and exit.

  See 'slcli vs create-options' for valid options