Skip to content

Commit

Permalink
Fix VM Provision datastore location class
Browse files Browse the repository at this point in the history
When building the `VirtualMachineRelocateSpec` the `datastore` property
is a `ManagedObjectReference` to a `Datastore`.  We were setting the
value to a simple `String` rather than a `VimString` with the proper
`xsiType`/`vimType`.

This would have broken when we moved from having VimString in ems_ref as
a serialized yaml column and added ems_ref_obj.
  • Loading branch information
agrare committed May 21, 2024
1 parent 1d9101d commit b8e8f34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def clone_vm(vim_clone_options)

def datastore_ems_ref(clone_opts)
datastore = Storage.find_by(:id => clone_opts[:datastore].id)
datastore.try(:ems_ref)
datastore.try(:ems_ref_obj)
end

def get_selected_snapshot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
before(:each) do
Array.new(2) do |i|
ds_mor = "datastore-#{i}"
storage = FactoryBot.create(:storage_nfs, :ems_ref => ds_mor, :ems_ref_type => "Datastore")
storage = FactoryBot.create(:storage_vmware, :ems_ref => ds_mor, :ems_ref_type => "Datastore")

cluster_mor = "cluster-#{i}"
cluster = FactoryBot.create(:ems_cluster, :ems_ref => cluster_mor)
Expand Down

0 comments on commit b8e8f34

Please sign in to comment.