尝试使用Vagrant和Rackspace,我能够在these instructions之后使用虚拟 .box 文件和不安全的Vagrant密钥对其进行假脱机。
Vagrant.configure("2") do |config|
#----------
# config.vm
#----------
config.vm.box = "dummy"
config.vm.box_url = "https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box"
#------------------
# config rackspace
#------------------
config.vm.provider :rackspace do |rs|
rs.username = "xxxxxx"
rs.api_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
rs.flavor = "1 GB Performance"
rs.image = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
rs.rackspace_region = "dfw"
rs.server_name = "test-vagrant"
end
end
尝试使用以下配置指定密钥对
Vagrant.configure("2") do |config|
#----------
# config.vm
#----------
config.vm.box = "dummy"
config.vm.box_url = "https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box"
#-----------
# config.ssh
#-----------
config.ssh.private_key_path = "/Users/natedogg/.ssh/id_rsa"
#------------------
# config rackspace
#------------------
config.vm.provider :rackspace do |rs|
rs.username = "xxxxxx"
rs.api_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
rs.flavor = "1 GB Performance"
rs.image = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
rs.rackspace_region = "dfw"
rs.server_name = "test-vagrant"
rs.public_key_path = "/Users/natedogg/.ssh/id_rsa.pub"
end
end
vagrant up --provider=rackspace
会产生Rackspace的HTTP 413。
〜/ .vagrant.d /宝石/宝石/ EXCON-0.31.0 / LIB / EXCON /中间件/ expects.rb:6:在 `response_call':[HTTP 413 | ]个性文件内容太长 (雾::计算:: RackspaceV2 ::服务错误)
rs.flavor
(512MB Standard Instance
)答案 0 :(得分:4)
当您将“个性”文件注入新启动的服务器时,您可以提供maximum filesize,您可以从limits endpoint找到该服务器。不幸的是,我没有看到从Vagrant查询的简单方法,但我希望这就是你所要达到的。我的是1000字节!
我建议您将公钥作为命名密钥对上传 - 您可以通过网络用户界面或the API进行上传 - 并为Vagrant提供密钥对名称:
config.vm.provider :rackspace do |rs|
rs.username = "xxxxxx"
rs.api_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
rs.flavor = "1 GB Performance"
rs.image = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
rs.rackspace_region = "dfw"
rs.server_name = "test-vagrant"
rs.key_name = "mykey"
end