0

我尝试订购 Baremetal 机器,但我收到了该错误

root@ubuntu:~# ruby array.rb
/usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/xmlrpc/client.rb:414:in `call': The location provided for this order is invalid. (XMLRPC::FaultException)
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/softlayer_api-3.0.2/lib/softlayer/Service.rb:267:in `call_softlayer_api_with_params'
from /usr/local/rvm/gems/ruby-1.9.3-p551/gems/softlayer_api-3.0.2/lib/softlayer/Service.rb:196:in `method_missing'
from array.rb:20:in `<main>'

我也尝试过使用 lon02(id 358694),但我发现了同样的错误。

我想自动化以下配置的顺序:

Server:
 Dual Intel Xeon E5-2650 (8 Cores, 2.00 GHz)
 Second Processor Intel Xeon E5-2650 (8 Cores, 2.00 GHz)
RAM:
 16 GB
Operating System:
 Ubuntu Linux 14.04 LTS Trusty Tahr - Minimal Install (64 bit)
Disk Controller:
 RAID
10 Hard Drives of type:
 800 GB SSD (10 DWPD)
 Disk 0-3 Raid 6. Disk 4 HotSpare - Disk 5-8 Raid 6 Disk 9 HotSpare
Public Bandwidth:
 500 GB Bandwidth
Uplink Port Speeds:
 1 Gbps Redundant Public & Private Network Uplinks
 Private Network Port 1 Gbps Redundant Private Uplinks
 Public Network Port 1 Gbps Redundant Public Uplinks
Power Supply:
 Redundant Power Supply
Monitoring:
 Host Ping and TCP Service Monitoring
Response:
 Automated Reboot from Monitoring
VPN Management - Private Network:
 Unlimited SSL VPN Users & 1 PPTP VPN User per account
Vulnerability Assessments & Management:
 Nessus Vulnerability Assessment & Reporting
Primary IP Addresses:
 1 IP Address
Notification:
 Email and Ticket
Remote Management:
 Reboot / KVM over IP

这是我的代码片段:

require 'rubygems'
require 'softlayer_api'

$SL_API_USERNAME = "-------"
$SL_API_KEY = "------------------"

client = SoftLayer::Service.new("SoftLayer_Product_Order");
product={
"complexType"=>"SoftLayer_Container_Product_Order_Hardware_Server", 
"quantity"=>1, 
"hardware"=>[{"hostname"=>"dysa-ca-east-0-baremetal-uaa-test-ai", "domain"=>"dysa-ca-east", "primaryNetworkComponent"=>{"networkVlan"=>{"id"=>"888013"}}, "primaryBackendNetworkComponent"=>{"networkVlan"=>{"id"=>"888015"}}}], 
"location"=>"448994", 
"packageId"=>142, 
"prices"=>[{"id"=>29899}, {"id"=>29899}, {"id"=>37622}, {"id"=>34742}, {"id"=>36037}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>35529}, {"id"=>33867}, {"id"=>26109}, {"id"=>25014}, {"id"=>34807}, {"id"=>34241}, {"id"=>32500}, {"id"=>34996}, {"id"=>33483}, {"id"=>35310}], "useHourlyPricing"=>false, 
"storageGroups"=>[{"arrayTypeId"=>"4", "hardDrives"=>"[0,1,2,3]", "hotSpareDrives"=>"[4]"}, {"arrayTypeId"=>"4", "hardDrives"=>"[5,6,7,8]", "hotSpareDrives"=>"[9]"}]}
client.verifyOrder(product)

你能帮帮我吗?非常感谢

4

3 回答 3

0

这是一个问题,您使用的软件包没有任何可用的数据中心,您可以通过运行此方法来验证:

http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getRegions

这是一个使用休息的例子:

https://api.softlayer.com/rest/v3/SoftLayer_Product_Package/142/getRegions

method: GET

这就是您收到错误消息的原因:为此订单提供的位置无效。

我建议你在 Softlayer 的 Portal 中打开一张票并报告问题,同时你可以尝试另一个包(如果你想要的话)。

问候

于 2016-02-05T13:14:29.600 回答
0

部分解决使用 packageId=251 但订购的裸机有 10xRAID 0 每个只有 1 个磁盘而不是 2xRAID 6 :((((以下代码有什么问题?

require 'rubygems'
require 'softlayer_api'

$SL_API_USERNAME = "-----"
$SL_API_KEY = "-----"

client = SoftLayer::Service.new("SoftLayer_Product_Order");
product={
"complexType"=>"SoftLayer_Container_Product_Order_Hardware_Server",
"quantity"=>1,
"hardware"=>[{"hostname"=>"dys1-0-baremetal-uaa",
"domain"=>"softlayer.com",
"primaryNetworkComponent"=>{"networkVlan"=>{"id"=>"MY_VLAN_ID"}},
"primaryBackendNetworkComponent"=>{"networkVlan"=>{"id"=>"MY_VLAN_ID"}}}],
"location"=>"358694",
"packageId"=>251,
"prices"=>[{"id"=>50675},
    {"id"=>37622},
    {"id"=>49427},
    {"id"=>141945},
    {"id"=>50143},
    {"id"=>50143},
    {"id"=>50143},
    {"id"=>50143},
    {"id"=>50143},
    {"id"=>50143},
    {"id"=>50143},
    {"id"=>50143},
    {"id"=>50143},
    {"id"=>50143},
    {"id"=>50263},
    {"id"=>26109},
    {"id"=>25014},
    {"id"=>34807},
    {"id"=>50223},
    {"id"=>34241},
    {"id"=>32500},
    {"id"=>34996},
    {"id"=>33483},
    {"id"=>35310}],
"useHourlyPricing"=>false,
"storageGroups"=>[{"arrayTypeId"=>4,
"hardDrives"=>[0,1,2,3],
"hotSpareDrives"=>[4]},
{"arrayTypeId"=>4,
"hardDrives"=>[5,6,7,8],
"hotSpareDrives"=>[9]}]
}

p client.verifyOrder(product)
于 2016-02-12T14:50:16.257 回答
0

此请求可以帮助您根据位置获取有效的商品价格:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/200/getItemPrices?objectMask=mask[id,item[keyName,description],pricingLocationGroup[locations[id, name, longName]]]

Method: GET

其中: 这些带有 locationGroupId = null 的价格 ID 被视为“标准价格”,API 将在内部为客户切换价格。但建议先执行 verifyOrder 以查看想要的订单是否正常(费用可能会有所不同)。要了解有关此的更多详细信息,请查看:

http://sldn.softlayer.com/blog/cmporter/Location-based-Pricing-and-You

这是在 PHP 中使用 itemPrices 的另一个示例。

https://softlayer.github.io/php/get_required_price_id/

如果问题仍然存在,请打开 SL 票,因为它可能是一个错误。

参考:

http://sldn.softlayer.com/blog/cmporter/Location-based-Pricing-and-You http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getItemPrices http://sldn.softlayer.com/参考/服务/SoftLayer_Product_Package/getAllObjects http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package

于 2016-02-05T12:23:11.447 回答