问题描述
我正在 https://console.bluemix.net/docs/cli/reference/softlayer/index.html#sl_vs_create 来创建新的虚拟服务器.我正在使用最新版本0.7.0.
I am following the IBM Cloud infrastructure (ibmcloud sl) cli documentation at https://console.bluemix.net/docs/cli/reference/softlayer/index.html#sl_vs_create to create a new virtual server. I am using the latest version 0.7.0.
我想从文件中读取用户数据,因此我尝试了-F和--userfile选项.
I want to read userdata from file, so I tried options -F and --userfile.
两个选项都给我同样的错误
Both options give me the same error
下面是完整的输入和输出:
Below is the full input and output:
~$ ibmcloud sl vs create --hostname node --domain mydomain.com --flavor B1_4X8X100 --datacenter syd04 --os CENTOS_7_64 --billing hourly --san --network 1000 -k 1111293 -k 1111295 -k 1111119 -F /Users/user/mycluster.sh
This action will incur charges on your account. Continue?> y
name value
ID 55627589
FQDN node.mydomain.com
created 2018-06-06T05:05:15Z
guid f67ced88-77dc-45f0-84df-8e5b1cca6f6c
Failed to update the user data of virtual server instance: 55627589.
SoftLayer_Exception_NotImplemented: SoftLayer_Virtual_Guest_Strategy_Behavior_Standard::setUserMetadata is not implemented. (HTTP 500)
有人能做到这一点吗?谢谢.
Has anyone got this working? Thanks.
推荐答案
默认情况下, ibmcloud sl 使用SoftLayer端点https://api.softlayer.com/rest/v3.1
来执行API调用,有关此 https://console.bluemix.net/docs/cli/reference/softlayer/index .html#sl_init
By default the ibmcloud sl uses the SoftLayer endpoint https://api.softlayer.com/rest/v3.1
to perform API calls, see here about this https://console.bluemix.net/docs/cli/reference/softlayer/index.html#sl_init
似乎 ibmcloud sl 中存在问题,因为正在调用的服务和方法不存在:
And it seems there is an issue in the ibmcloud sl because the service and method that is calling doesn't exists:
此处 https://softlayer.github列出了SoftLayer API中的可用服务和数据类型. io/reference/softlayerapi/
作为建议,您可以尝试使用SoftLayer开发人员提供的CLI命令SLCLI,在此处找到文档:
As a suggestion you can try by using the CLI command provided by SoftLayer developers which is called SLCLI, you can find documentation here:
https://softlayer-python.readthedocs.io/en /latest/cli/vs.html
https://github.com/softlayer/softlayer-python
以下是创建虚拟访客时可以使用的选项:
Bellow are the options you can use when creating a virtual guest:
$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
这篇关于IBM Cloud Infrastructure CLI错误-未实现setUserMetadata的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!