From 477fbdd4a9cf5a5780258062695699901864a706 Mon Sep 17 00:00:00 2001 From: Timo Goebel Date: Tue, 10 Nov 2015 14:22:49 +0100 Subject: [PATCH 1/7] vsphere: allow setting of boot order when using api > 5.0 --- lib/fog/vsphere/requests/compute/create_vm.rb | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/lib/fog/vsphere/requests/compute/create_vm.rb b/lib/fog/vsphere/requests/compute/create_vm.rb index 84eb989ba..83a6369b7 100644 --- a/lib/fog/vsphere/requests/compute/create_vm.rb +++ b/lib/fog/vsphere/requests/compute/create_vm.rb @@ -19,6 +19,7 @@ module Fog vm_cfg[:cpuHotAddEnabled] = attributes[:cpuHotAddEnabled] if attributes.key?(:cpuHotAddEnabled) vm_cfg[:memoryHotAddEnabled] = attributes[:memoryHotAddEnabled] if attributes.key?(:memoryHotAddEnabled) vm_cfg[:firmware] = attributes[:firmware] if attributes.key?(:firmware) + vm_cfg[:bootOptions] = boot_options(attributes) if attributes.key?(:boot_order) resource_pool = if attributes[:resource_pool] get_raw_resource_pool(attributes[:resource_pool], attributes[:cluster], attributes[:datacenter]) else @@ -54,6 +55,63 @@ module Fog devices.flatten end + def boot_options attributes + # NOTE: you must be using vsphere_rev 5.0 or greater to set boot_order + # e.g. Fog::Compute.new(provider: "vsphere", vsphere_rev: "5.5", etc) + RbVmomi::VIM::VirtualMachineBootOptions.new( + :bootOrder => boot_order(attributes) + ) + end + + def boot_order attributes + # attributes[:boot_order] may be an array like this ['network', 'disk'] + # stating, that we want to prefer network boots over disk boots + boot_order = [] + attributes[:boot_order].each do |boot_device| + case boot_device + when 'network' + if nics = attributes[:interfaces] + # key is based on 4000 + the interface index + # we allow booting from all network interfaces, the first interface has the highest priority + nics.each do |nic| + boot_order << RbVmomi::VIM::VirtualMachineBootOptionsBootableEthernetDevice.new( + :deviceKey => 4000 + nics.index(nic), + ) + end + end + when 'disk' + if disks = attributes[:volumes] + disks.each do |disk| + # we allow booting from all harddisks, the first disk has the highest priority + boot_order << RbVmomi::VIM::VirtualMachineBootOptionsBootableDiskDevice.new( + :deviceKey => disk.key || get_disk_device_key(disks.index(disk)), + ) + end + end + when 'cdrom' + boot_order << RbVmomi::VIM::VirtualMachineBootOptionsBootableCdromDevice.new() + when 'floppy' + boot_order << RbVmomi::VIM::VirtualMachineBootOptionsBootableFloppyDevice.new() + else + raise "failed to create boot device because \"#{boot_device}\" is unknown" + end + end + boot_order + end + + def get_disk_device_key(index) + # disk key is based on 2000 + the SCSI ID + the controller bus * 16 + # the scsi host adapter appears as SCSI ID 7, so we have to skip that + # host adapter key is based on 1000 + bus id + # fog assumes that there is only a single scsi controller, see device_change() + if (index > 6) then + _index = index + 1 + else + _index = index + end + 2000 + _index + end + def create_nic_backing nic, attributes raw_network = get_raw_network(nic.network, attributes[:datacenter], if nic.virtualswitch then nic.virtualswitch end) From 0733e133deed7e89ba0a8019b22dd91c20cbf004 Mon Sep 17 00:00:00 2001 From: Daniyal Shah Date: Sat, 14 Nov 2015 00:02:26 +0500 Subject: [PATCH 2/7] version for fog-aliyun added in fog.gemspec --- fog.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fog.gemspec b/fog.gemspec index 17e5e68fb..4e64595da 100644 --- a/fog.gemspec +++ b/fog.gemspec @@ -74,7 +74,7 @@ Gem::Specification.new do |s| s.add_dependency("fog-vmfusion") s.add_dependency("fog-voxel") s.add_dependency("fog-xenserver") - s.add_dependency("fog-aliyun") + s.add_dependency("fog-aliyun",">= 0.1.0") s.add_development_dependency("docker-api", ">= 1.13.6") s.add_development_dependency("fission") From e55253c6f724b8abc0a107dae89ae2b0a38a85db Mon Sep 17 00:00:00 2001 From: geemus Date: Sun, 15 Nov 2015 17:45:27 -0600 Subject: [PATCH 3/7] re-add 1.9 to travis config --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index fe1856fe8..f58a54bf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,12 @@ sudo: false script: bundle exec rake travis rvm: + - 1.9 - 2.0 - 2.1 - 2.2 - jruby-head + - jruby-19mode gemfile: - Gemfile From 0cb6a12a8196b5d867baea6e0e2219ab5abc8ced Mon Sep 17 00:00:00 2001 From: geemus Date: Sun, 15 Nov 2015 17:59:08 -0600 Subject: [PATCH 4/7] limit to 1.9 compat fog-google --- fog.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fog.gemspec b/fog.gemspec index 4e64595da..7dad70f11 100644 --- a/fog.gemspec +++ b/fog.gemspec @@ -60,7 +60,7 @@ Gem::Specification.new do |s| s.add_dependency("fog-brightbox", "~> 0.4") s.add_dependency("fog-dynect", "~> 0.0.2") s.add_dependency("fog-ecloud", "~> 0.1") - s.add_dependency("fog-google", ">= 0.1.1") + s.add_dependency("fog-google", "<= 0.1.0") s.add_dependency("fog-local") s.add_dependency("fog-powerdns", ">= 0.1.1") s.add_dependency("fog-profitbricks") From e7cd19696284633d4363993e2e3fda41384b7d58 Mon Sep 17 00:00:00 2001 From: geemus Date: Mon, 16 Nov 2015 09:13:56 -0600 Subject: [PATCH 5/7] 1.8 compatibility for pre 2 release --- fog.gemspec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fog.gemspec b/fog.gemspec index 7dad70f11..e1cb304f7 100644 --- a/fog.gemspec +++ b/fog.gemspec @@ -44,15 +44,12 @@ Gem::Specification.new do |s| s.rdoc_options = ["--charset=UTF-8"] s.extra_rdoc_files = %w[README.md] - ## Ruby version - s.required_ruby_version = ">= 2.0.0" - s.add_dependency("fog-core", "~> 1.32") s.add_dependency("fog-json") s.add_dependency("fog-xml", "~> 0.1.1") s.add_dependency("ipaddress", "~> 0.5") - s.add_dependency("nokogiri") + s.add_dependency("nokogiri", "~> 1.5", ">= 1.5.11") # Modular providers (please keep sorted) s.add_dependency("fog-atmos") From 46c9df8a175d61980ac58ab04f7c2377bdd8d7f6 Mon Sep 17 00:00:00 2001 From: geemus Date: Mon, 16 Nov 2015 09:16:55 -0600 Subject: [PATCH 6/7] Release 1.36.0 --- CHANGELOG.md | 50 +++++++++++++++++++++++++++++++++++++ fog.gemspec | 4 +-- lib/fog/version.rb | 2 +- lib/tasks/changelog_task.rb | 1 + 4 files changed, 54 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64cdc9767..22049eb41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,53 @@ +## 1.36.0 11/16/2015 +*Hash* e7cd19696284633d4363993e2e3fda41384b7d58 + +Statistic | Value +------------- | --------: +Collaborators | 2 +Downloads | 12793379 +Forks | 1517 +Open Issues | 92 +Watchers | 3689 + +**MVP!** Phil Ross + +#### [misc] +* added content-encoding meta-data. thanks ller +* version for fog-aliyun added in fog.gemspec. thanks Daniyal Shah +* Digital Ocean V2 call to create an ssh key returns a 201 on success: https://developers.digitalocean.com/documentation/v2/#create-a-new-key. thanks Dave Benvenuti +* improve mocks to more closely match real ssh key endpoint functionality. thanks Dave Benvenuti +* Fix issue when creating virtual machines with more than 7 disks. thanks Francois Herbert +* Fix distributed port group switches support for cloning with multiple networks. thanks as +* Extract virtualswitch parameter to the network model. thanks as +* fix openstack baremetal node delete. thanks Jason Montleon +* Fixed issue with OpenStack Auth v2. thanks ller +* Fix set node type for Rackspace load balancer. thanks Pablo Porto +* Add abbr attribute to Linode DataCenter. thanks Phil Ross +* Add created_at and requires_pvops_kernel to Linode Image model. thanks Phil Ross +* Update the Linode avail_kernels request and Kernel model. thanks Phil Ross +* Update the Linode avail_linodeplans request and Flavor model. thanks Phil Ross +* Add support for the Linode avail.nodebalancers API call. thanks Phil Ross +* Fix the signature of the Linode avail_stackscripts mock. thanks Phil Ross +* Use options on the all method to filter Linode kernels. thanks Phil Ross +* fix method call name in openstack node destroy so that it will work. thanks Stephen Herr +* vsphere: allow setting of boot order when using api > 5.0. thanks Timo Goebel +* Revert "temporarily relax ruby version constraint". thanks geemus +* make net/ssh require optional. thanks geemus +* re-add 1.9 to travis config. thanks geemus +* limit to 1.9 compat fog-google. thanks geemus +* 1.8 compatibility for pre 2 release. thanks geemus + +#### [openstack] +* Basic caching support for auth tokens, domains & projects. thanks Darren Hague +* Re-record VCRs, plus some light refactoring. thanks Darren Hague + +#### [vsphere] +* add support for taking snapshot. thanks Ivo Reznicek +* support for snapshot list and revert. thanks Ivo Reznicek +* support for listing processes in guest OS. thanks Ivo Reznicek +* Prefer Class#name to Class#to_s. thanks Kevin Menard + + ## 1.35.0 10/20/2015 *Hash* 4444f3287454a4281ead73fa24aa1b93d5d23a39 diff --git a/fog.gemspec b/fog.gemspec index e1cb304f7..e4abc9811 100644 --- a/fog.gemspec +++ b/fog.gemspec @@ -11,8 +11,8 @@ Gem::Specification.new do |s| ## If your rubyforge_project name is different, then edit it and comment out ## the sub! line in the Rakefile s.name = "fog" - s.version = "1.35.0" - s.date = "2015-10-20" + s.version = "1.36.0" + s.date = "2015-11-16" s.rubyforge_project = "fog" ## Make sure your summary is short. The description may be as long diff --git a/lib/fog/version.rb b/lib/fog/version.rb index 3a8994221..ab636f34a 100644 --- a/lib/fog/version.rb +++ b/lib/fog/version.rb @@ -1,3 +1,3 @@ module Fog - VERSION = '1.35.0' + VERSION = '1.36.0' end diff --git a/lib/tasks/changelog_task.rb b/lib/tasks/changelog_task.rb index 017dbd427..a74c9d60e 100644 --- a/lib/tasks/changelog_task.rb +++ b/lib/tasks/changelog_task.rb @@ -141,6 +141,7 @@ Watchers | #{watchers} 'Paul Thornthwaite', 'Paulo Henrique Lopes Ribeiro', 'Peter Souter', + 'Phil Ross', 'Rodrigo Estebanez', 'Rupak Ganguly', 'Stepan G. Fedorov', From 2d94746b1986306afd981241f8dcb311d77b13eb Mon Sep 17 00:00:00 2001 From: geemus Date: Mon, 16 Nov 2015 09:37:06 -0600 Subject: [PATCH 7/7] rely on fog-xml nokogiri dep --- fog.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/fog.gemspec b/fog.gemspec index e4abc9811..fdc0f32b3 100644 --- a/fog.gemspec +++ b/fog.gemspec @@ -49,7 +49,6 @@ Gem::Specification.new do |s| s.add_dependency("fog-xml", "~> 0.1.1") s.add_dependency("ipaddress", "~> 0.5") - s.add_dependency("nokogiri", "~> 1.5", ">= 1.5.11") # Modular providers (please keep sorted) s.add_dependency("fog-atmos")