fog-vsphere 3.7.0 → 3.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/fog/vsphere/compute.rb +1 -1
 - data/lib/fog/vsphere/models/compute/server.rb +2 -2
 - data/lib/fog/vsphere/requests/compute/create_vm.rb +4 -4
 - data/lib/fog/vsphere/requests/compute/get_virtual_machine.rb +4 -0
 - data/lib/fog/vsphere/requests/compute/vm_clone.rb +2 -1
 - data/lib/fog/vsphere/version.rb +1 -1
 - data/tests/fixtures/vcr_cassettes/6_7/get_template.yml +7750 -50
 - data/tests/fixtures/vcr_cassettes/6_7/get_virtual_machine.yml +7925 -44
 - data/tests/helper.rb +2 -3
 - data/tests/requests/compute/get_template_tests.rb +2 -2
 - data/tests/requests/compute/get_virtual_machine_tests.rb +2 -2
 - data/tests/test_helper.rb +4 -1
 - metadata +3 -6
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 924b9bbb6dc4715d151b6737ab5a7c29ba114e3c8f3e3d05366d29a5f164c52e
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: bca22014a94f40e12301c2f18664242effbd09c984cff91e134947f5a4e799c1
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: c7d777833b52e0184c94818bf6876ae3ee518425c57f9ae922b1f66b0f92b20c832e16e358d7e280c91ba2fa12f65c6469a231fe97ee55680c253541c09f817f
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 5006c14b999ba3ee502a423a953407b1cbd5739f2de946adb67026dfadc08a937d7b770839d1110b5792b1a26e0eac8ba83a8f7f455bc8d51e86ec9390b7e6a9
         
     | 
    
        data/lib/fog/vsphere/compute.rb
    CHANGED
    
    | 
         @@ -347,7 +347,7 @@ module Fog 
     | 
|
| 
       347 
347 
     | 
    
         
             
                    end
         
     | 
| 
       348 
348 
     | 
    
         | 
| 
       349 
349 
     | 
    
         
             
                    def is_uuid?(id)
         
     | 
| 
       350 
     | 
    
         
            -
                       
     | 
| 
      
 350 
     | 
    
         
            +
                      id.is_a?(String) && /[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/.match?(id)
         
     | 
| 
       351 
351 
     | 
    
         
             
                    end
         
     | 
| 
       352 
352 
     | 
    
         
             
                  end
         
     | 
| 
       353 
353 
     | 
    
         | 
| 
         @@ -290,11 +290,11 @@ module Fog 
     | 
|
| 
       290 
290 
     | 
    
         
             
                    end
         
     | 
| 
       291 
291 
     | 
    
         | 
| 
       292 
292 
     | 
    
         
             
                    def scsi_controllers
         
     | 
| 
       293 
     | 
    
         
            -
                      attributes[:scsi_controllers] ||= service.list_vm_scsi_controllers(id)
         
     | 
| 
      
 293 
     | 
    
         
            +
                      attributes[:scsi_controllers] ||= id.nil? ? [] : service.list_vm_scsi_controllers(id)
         
     | 
| 
       294 
294 
     | 
    
         
             
                    end
         
     | 
| 
       295 
295 
     | 
    
         | 
| 
       296 
296 
     | 
    
         
             
                    def nvme_controllers
         
     | 
| 
       297 
     | 
    
         
            -
                      attributes[:nvme_controllers] ||= service.list_vm_nvme_controllers(id)
         
     | 
| 
      
 297 
     | 
    
         
            +
                      attributes[:nvme_controllers] ||= id.nil? ? [] : service.list_vm_nvme_controllers(id)
         
     | 
| 
       298 
298 
     | 
    
         
             
                    end
         
     | 
| 
       299 
299 
     | 
    
         | 
| 
       300 
300 
     | 
    
         
             
                    def scsi_controller
         
     | 
| 
         @@ -136,7 +136,7 @@ module Fog 
     | 
|
| 
       136 
136 
     | 
    
         
             
                    def device_change(attributes)
         
     | 
| 
       137 
137 
     | 
    
         
             
                      devices = []
         
     | 
| 
       138 
138 
     | 
    
         
             
                      if (nics = attributes[:interfaces])
         
     | 
| 
       139 
     | 
    
         
            -
                        devices << nics.map { |nic| create_interface(nic,  
     | 
| 
      
 139 
     | 
    
         
            +
                        devices << nics.each_with_index.map { |nic, index| create_interface(nic, index, :add, attributes) }
         
     | 
| 
       140 
140 
     | 
    
         
             
                      end
         
     | 
| 
       141 
141 
     | 
    
         | 
| 
       142 
142 
     | 
    
         
             
                      if (scsi_controllers = attributes[:scsi_controllers] || attributes['scsi_controller'])
         
     | 
| 
         @@ -152,7 +152,7 @@ module Fog 
     | 
|
| 
       152 
152 
     | 
    
         
             
                      end
         
     | 
| 
       153 
153 
     | 
    
         | 
| 
       154 
154 
     | 
    
         
             
                      if (cdroms = attributes[:cdroms])
         
     | 
| 
       155 
     | 
    
         
            -
                        devices << cdroms.map { |cdrom| create_cdrom(cdrom,  
     | 
| 
      
 155 
     | 
    
         
            +
                        devices << cdroms.each_with_index.map { |cdrom, index| create_cdrom(cdrom, index) }
         
     | 
| 
       156 
156 
     | 
    
         
             
                      end
         
     | 
| 
       157 
157 
     | 
    
         | 
| 
       158 
158 
     | 
    
         
             
                      devices << create_virtual_tpm if attributes[:virtual_tpm]
         
     | 
| 
         @@ -189,9 +189,9 @@ module Fog 
     | 
|
| 
       189 
189 
     | 
    
         
             
                          if nics = attributes[:interfaces]
         
     | 
| 
       190 
190 
     | 
    
         
             
                            # key is based on 4000 + the interface index
         
     | 
| 
       191 
191 
     | 
    
         
             
                            # we allow booting from all network interfaces, the first interface has the highest priority
         
     | 
| 
       192 
     | 
    
         
            -
                            nics. 
     | 
| 
      
 192 
     | 
    
         
            +
                            nics.each_with_index do |_nic, index|
         
     | 
| 
       193 
193 
     | 
    
         
             
                              boot_order << RbVmomi::VIM::VirtualMachineBootOptionsBootableEthernetDevice.new(
         
     | 
| 
       194 
     | 
    
         
            -
                                deviceKey: 4000 +  
     | 
| 
      
 194 
     | 
    
         
            +
                                deviceKey: 4000 + index
         
     | 
| 
       195 
195 
     | 
    
         
             
                              )
         
     | 
| 
       196 
196 
     | 
    
         
             
                            end
         
     | 
| 
       197 
197 
     | 
    
         
             
                          end
         
     | 
| 
         @@ -3,6 +3,8 @@ module Fog 
     | 
|
| 
       3 
3 
     | 
    
         
             
                class Compute
         
     | 
| 
       4 
4 
     | 
    
         
             
                  class Real
         
     | 
| 
       5 
5 
     | 
    
         
             
                    def get_virtual_machine(id, datacenter_name = nil, folder = nil, recursive = false)
         
     | 
| 
      
 6 
     | 
    
         
            +
                      raise(Fog::Vsphere::Compute::NotFound, "The id of the virtual machine can't be nil") if id.nil?
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
       6 
8 
     | 
    
         
             
                      # The larger the VM list the longer it will take if not searching based on UUID.
         
     | 
| 
       7 
9 
     | 
    
         
             
                      convert_vm_mob_ref_to_attr_hash(get_vm_ref(id, datacenter_name, folder, recursive))
         
     | 
| 
       8 
10 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -10,6 +12,8 @@ module Fog 
     | 
|
| 
       10 
12 
     | 
    
         
             
                    protected
         
     | 
| 
       11 
13 
     | 
    
         | 
| 
       12 
14 
     | 
    
         
             
                    def get_vm_ref(id, dc = nil, folder = nil, recursive = false)
         
     | 
| 
      
 15 
     | 
    
         
            +
                      raise(Fog::Vsphere::Compute::NotFound, "The id of the virtual machine can't be nil") if id.nil?
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
       13 
17 
     | 
    
         
             
                      raw_datacenter = find_raw_datacenter(dc) if dc
         
     | 
| 
       14 
18 
     | 
    
         
             
                      vm = case is_uuid?(id)
         
     | 
| 
       15 
19 
     | 
    
         
             
                             # UUID based
         
     | 
| 
         @@ -173,6 +173,7 @@ module Fog 
     | 
|
| 
       173 
173 
     | 
    
         
             
                        device_change.concat(modify_template_volumes_specs(vm_mob_ref, options['volumes']))
         
     | 
| 
       174 
174 
     | 
    
         
             
                        device_change.concat(add_new_volumes_specs(vm_mob_ref, options['volumes'])) unless options['storage_pod']
         
     | 
| 
       175 
175 
     | 
    
         
             
                      end
         
     | 
| 
      
 176 
     | 
    
         
            +
                      device_change << create_virtual_tpm if options['virtual_tpm'].present?
         
     | 
| 
       176 
177 
     | 
    
         
             
                      virtual_machine_config_spec.deviceChange = device_change if device_change.any?
         
     | 
| 
       177 
178 
     | 
    
         
             
                      # Options['numCPUs'] or Options['memoryMB']
         
     | 
| 
       178 
179 
     | 
    
         
             
                      # Build up the specification for Hardware, for more details see ____________
         
     | 
| 
         @@ -216,7 +217,7 @@ module Fog 
     | 
|
| 
       216 
217 
     | 
    
         
             
                            RbVmomi::VIM::VirtualMachineBootOptionsBootableFloppyDevice.new
         
     | 
| 
       217 
218 
     | 
    
         
             
                          end
         
     | 
| 
       218 
219 
     | 
    
         
             
                        end
         
     | 
| 
       219 
     | 
    
         
            -
                        virtual_machine_config_spec.bootOptions = { bootOrder: boot_order }
         
     | 
| 
      
 220 
     | 
    
         
            +
                        virtual_machine_config_spec.bootOptions = { bootOrder: boot_order, efiSecureBootEnabled: options["secure_boot"] || false }
         
     | 
| 
       220 
221 
     | 
    
         
             
                      end
         
     | 
| 
       221 
222 
     | 
    
         
             
                      # Options['customization_spec']
         
     | 
| 
       222 
223 
     | 
    
         
             
                      # OLD Options still supported
         
     | 
    
        data/lib/fog/vsphere/version.rb
    CHANGED