Skip to content

Instantly share code, notes, and snippets.

@chris1984
Last active December 17, 2019 17:16
Show Gist options
  • Save chris1984/46ee6287452267893f10ed8a2cda58d8 to your computer and use it in GitHub Desktop.
Save chris1984/46ee6287452267893f10ed8a2cda58d8 to your computer and use it in GitHub Desktop.
vm-clone.patch
diff --git a/app/models/compute_resources/foreman/model/vmware.rb b/app/models/compute_resources/foreman/model/vmware.rb
index 58b6d9c..5bd8df3 100644
--- a/app/models/compute_resources/foreman/model/vmware.rb
+++ b/app/models/compute_resources/foreman/model/vmware.rb
@@ -447,10 +447,14 @@ module Foreman::Model
args = parse_networks(args)
args = args.with_indifferent_access
if args[:provision_method] == 'image'
+ Rails.logger.error "VMW: args #{args.inspect}"
clone_vm(args)
else
+ Rails.logger.error "VMW: args #{args.inspect}"
vm = new_vm(args)
vm.firmware = 'bios' if vm.firmware == 'automatic'
+ Rails.logger.error "VMW: vm attributes #{vm.attributes.inspect}"
+ Rails.logger.error "VMW: vm volumes #{vm.volumes.inspect}"
vm.save
end
rescue Fog::Compute::Vsphere::NotFound => e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment