Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM]VXFM-6201 :Verify the SVM we are configuring is on the correct host #292

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions lib/puppet/provider/vc_vm/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,7 @@ def vm_version_upgrade(vm, version)
def deploy_ovf
vm_name = resource[:name]
ovf_url = resource[:ovf_url]
resource[:vm_folder_path] = resource[:cluster]
dc = vim.serviceInstance.find_datacenter(resource[:datacenter])
datastore = dc.find_datastore(resource[:datastore])
cluster = dc.find_compute_resource(resource[:cluster])
Expand All @@ -1327,11 +1328,8 @@ def deploy_ovf

# Use root vm folder for deployment if no folder passed in as input
root_vm_folder = dc.vmFolder
vm_folder = root_vm_folder
if resource[:vm_folder_path]
vm_folder = root_vm_folder.traverse(resource[:vm_folder_path], VIM::Folder)
raise("Could not find VM folder: %s" % resource[:vm_folder_path])
end
vm_folder ||= root_vm_folder.traverse(resource[:vm_folder_path], VIM::Folder, true) if resource[:vm_folder_path]
raise("Could not find VM folder: %s" % resource[:vm_folder_path]) unless vm_folder
Puppet.debug("Using vm folder: %s" % vm_folder.name)

# Find host associated with the target datastore for this VM
Expand Down Expand Up @@ -1462,7 +1460,7 @@ def datacenter(name=resource[:datacenter])
end

def vm
@vm ||= findvm_by_name(datacenter.vmFolder, resource[:name])
@vm ||= findvm_by_name(datacenter.vmFolder.find(resource[:cluster]), resource[:name])
end

def dvswitch(dv_switch_name)
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/vc_vm_pci_passthru/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def datacenter
end

def vm
@__vm ||= findvm_by_name(datacenter.vmFolder, resource[:name])
@__vm ||= findvm_by_name(datacenter.vmFolder.find(resource[:cluster]), resource[:name])
end

# finds host to add nfs_datastore and returns the host object
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/vc_vm_rdm/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@doc = 'Processes RDM disks'

def vm
@vm ||= findvm_by_name(datacenter.vmFolder, resource[:name])
@vm ||= findvm_by_name(datacenter.vmFolder.find(resource[:cluster]), resource[:name])
end

def datacenter(name=resource[:datacenter])
Expand Down