From 09bd28048ebcd66423df01fef9fca582814be219 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Tue, 31 Mar 2020 11:28:51 -0700 Subject: [PATCH] Add driver method for attaching a new disk for hyper-v guests --- plugins/providers/hyperv/driver.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/plugins/providers/hyperv/driver.rb b/plugins/providers/hyperv/driver.rb index 4f95db8c7..92222fee2 100644 --- a/plugins/providers/hyperv/driver.rb +++ b/plugins/providers/hyperv/driver.rb @@ -28,6 +28,28 @@ module VagrantPlugins @vm_id = id end + # + # Disk Driver methods + # + + # @param [String] controller_type + # @param [String] controller_number + # @param [String] controller_location + # @param [Hash] opts + def attach_disk(controller_type, controller_number, controller_location, disk_file_path, **opts) + execute(:attach_disk_drive, @vm_id, controller_type, controller_numer, + controller_location, disk_file_path) + end + + def new_vdh(path, size_bytes, **opts) + execute(:new_vdh, @vm_id, path, size_bytes) + end + + + ######## + ######## + ######## + # @return [Boolean] Supports VMCX def has_vmcx_support? !!execute(:has_vmcx_support)["result"]