ruby 雾试验

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby 雾试验相关的知识,希望对你有一定的参考价值。

#!/usr/bin/env ruby

require 'fog'

client = ::Fog::Compute.new(
  :provider                     => 'vsphere',
  :vsphere_username             => '',
  :vsphere_password             => '',
  :vsphere_server               => '',
  :vsphere_expected_pubkey_hash => '',
)


interface_attrs = {
  network: 'LX-LAN-VLAN-775',
  type: 'VirtualE1000'
}

attrs = {
  :name => 'some.example.com',
  :memory_mb => '768',
  :interfaces => [ interface_attrs ],
  :volumes => [
    {
      :storage_pod => 'Some-Mirror-Pod',
      :name => 'Hard disk',
      :size_gb => '10',
      :thin => 'true',
      :eager_zero => 'false'
    }
  ],
  :scsi_controller=> {
    :type=>"VirtualLsiLogicController"
  },
  :datacenter => "Toledo",
  :boot_order => ["network", "disk"],
  :cpus => "1",
  :corespersocket => "1",
  :cluster=>"Some-Cluster",
  :resource_pool=>"default",
  :path => "/Datencenter/Some/path",
  :guest_id=>"rhel7_64Guest",
  :memoryHotAddEnabled=>"1",
  :cpuHotAddEnabled=>"1",
  :start=>"1",
  :annotation=>"test vm"
}

vm = client.servers.new(attrs)

vm.save

以上是关于ruby 雾试验的主要内容,如果未能解决你的问题,请参考以下文章

ruby 用于删除所有云文件和容器的Ruby脚本 - 也就是关闭帐户。需要宝石'雾'和'哑剧类型'

Ruby 雾 gem 导致服务器无法运行:无法加载此类文件 -- xmlrpc/client (LoadError)

ruby CarrierWave带有来自雾的备用URL,快速而肮脏。对于将生产数据提取到开发中非常有用,以防万一你必须全力以赴

ruby 西纳特拉辅助试验02.rb

ruby 西纳特拉辅助试验01.rb

OVH 的 OpenStack Swift 的雾配置