SCVMM Provider Cloning.rb changes


#1

I would like to append to the dest_mount_point variable in /var/www/miq/vmdb/app/models/manageiq/providers/microsoft/infra_manager/provision/cloning.rb

We have subfolders within our data stores where newly provisioned machines should go, rather than in the root.

I have tried the following

def dest_mount_point
name = dest_datastore.name.scan(MT_POINT_REGEX).flatten.pop
URI.decode(name.to_s).tr(’/’, ‘\’) << '\VMs’
end

This changes the path to forward slashes already in variable name and correctly appends \VMs, so SCVMM complains that it cannot find the path

And in build_ps_script

$vm = New-SCVirtualMachine
-Name ‘#{dest_name}’
-ComputerName ‘#{dest_name}’
-VMHost #{dest_host}
-Path ‘#{dest_mount_point}’ << ‘\VMs’ \

This method returns an error in the script formulation, complaining that &lt $lt is reserved.

What’s the correct way to achieve this append to the data store location?


#2

I think the new fileshare code will just allow you to share a directory on Hyper-V and select that for placement. Looking at it now.