Commit Graph

95 Commits

Author SHA1 Message Date
Brian Retford 418064519d Move dynamic memory settings into conditional block 2016-10-14 18:53:44 -07:00
Jake Ballard 803fff7f03 Fix issue with missing slash in paths
It was failing to create files below the machines\default\hyperv folder, rather it was creating folders named 'hypervSnapshots', 'hypervVirtual Hard Disks', and 'hypervVirtual Machines'. This was causing the files to not be removed when destroying the vm, and an error when subsequently bringing it up again.
2016-10-11 15:31:28 -05:00
Bjorn Brala 42efd5c198 Make the Virtual Hard Disks directory if importing from XML to keep it consistant across config types 2016-10-09 21:10:56 +02:00
Bjorn Brala 8744caebcf Small typo in options 2016-10-09 20:39:17 +02:00
Bjorn Brala 7b03bf335b Whitespace 2016-10-08 16:44:24 +02:00
Bjorn Brala debe50957b Refactor the import script to fully use Compare-VM for creating the new VM.
Implemented the differencing disk for vmcx.
This means the disk is now copied by Hyper-V (Powershell) instead of Ruby for new machines.
This does mean EFI Firmware now does work for machines since it is quite a feep copy. Compare-VM will report incompatibilities should they be found.
2016-10-08 16:38:42 +02:00
Bjorn Brala a77da314e5 Only check for .vmcx if there is no XML found to not risk breaking older vagrant boxes that added an XML file manually 2016-10-07 20:38:05 +02:00
Bjorn Brala 133e2a7b0f Broke Path argument in mini refactor. 2016-10-04 20:06:10 +02:00
Bjorn Brala 2fc93277fd change argument to vm_config_file so it isn't the same as variable in powershell script. 2016-10-02 18:45:51 +02:00
Bjorn Brala 1ec1cf8177 Update Hyper-V import command and the driver to check for configuration type and call the correct import script. 2016-10-02 16:10:58 +02:00
Bjorn Brala b041c1955c Add support for vmcx files, new binary format for Hyper-V configurations. 2016-10-02 16:10:16 +02:00
tfanning d350fd0d28 Resolve whitespace 2016-07-26 13:56:20 +01:00
tfanning 344fc0ea7b Implement auto_start_action and auto_stop_action 2016-07-26 13:41:01 +01:00
Rory Plaire d3859a33aa Fixing version check and catch statement in get_vm_status
Use the version of Hyper-V instead of Powershell to determine which
exception is thrown by Get-VM. Also fixing an invalid catch statement,
since Powershell can not use variables to match thrown exceptions in
catch.
2016-06-18 17:13:24 -07:00
Ray Ruvinskiy e42f346b1d
Make `start` action run provisioners if VM is running
Previously, there was no one gesture that would start a VM if it was not
running and run the appropriate provisioners regardless of its original
state. `vagrant up` did nothing if the VM was running, while
`vagrant provision` did nothing if the VM was not running.

Change the semantics of `vagrant up`, via the start actions of the providers,
to go through the provisioning logic even if the VM is already running.
The semantics of `run: "once"` vs `run: "always"` are respected.

Tested with the VirtualBox provider but not the others.

Resolves #4421
2016-05-27 19:00:33 -04:00
Seth Vargo 08550b6888 Merge pull request #7108 from jtopper/fix_hyperv_status_exception
HyperV: Reinstate compatibility with PowerShell 4
2016-05-20 10:46:01 -04:00
Jon Topper 0a7c20a93a Determine status behaviour based on PS version 2016-05-13 17:50:24 +01:00
Jon Topper df4caf0757 Add snapshots to Hyper-V driver 2016-05-13 16:58:08 +01:00
Seth Vargo 6c01aaf6ab Merge pull request #7090 from mac2000/master
hyperv differencing disk
2016-04-17 23:14:29 +05:30
Matt Wrock 508492faae fixes #7098 only specifying Hyper-V generation if the parameter is supported 2016-03-04 23:42:17 -08:00
Marchenko Alexandr 51d7c98d49 hyperv differencing disk 2016-03-01 17:23:38 +02:00
Kevin Blair 026243c88b Typo
Changed message to match HyperV terminology
2016-02-16 14:58:42 +00:00
Kevin Blair 343a43cae6 Preserve Disk Image Name
detect and preserve the original name of the disk image rather than forcing it to be disk
2016-02-16 14:57:53 +00:00
Luke Bakken 57187c9f88 Add method to detect if a Windows user is a member of the "Hyper-V Administrators" group.
Modify Hyper-V provider to require a user to either be an Administrator or a member of "Hyper-V Administrators"
2015-12-10 07:04:39 -08:00
Mitchell Hashimoto 24799575c3 providers/hyperv: fix error 2015-11-23 12:06:11 -08:00
Mitchell Hashimoto b23b48a614 providers/hyper-v: support more than one NIC [GH-4346] 2015-11-23 12:05:37 -08:00
Mitchell Hashimoto 55e872eda4 Merge pull request #6118 from mjaverto/patch-1
Fix Win 10 Enterprise Vagrant Error
2015-11-23 11:45:23 -08:00
Seth Vargo 825bd6d5ef Run provisioner cleanup tasks before destroying the VM 2015-11-19 11:14:31 -08:00
Mitchell Hashimoto d89bd56d27 Merge pull request #6373 from caleblloyd/patch-1
Hyper-V: select boot device by VM generation
2015-11-18 14:16:54 -08:00
caleblloyd 00894b5a27 hyper-v boot device by generation fixes #6372 2015-10-07 20:25:09 -04:00
tomfanning 41beaac074 Hyper-V set mac address 2015-09-22 11:35:55 +01:00
Mike Averto 587c88e65a Fix Win 10 Enterprise Vagrant Error
This fixes error for Win 10 Enterprise:

An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please
report a bug.

Script: get_vm_status.ps1
Error:

C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\providers\hyperv\scripts\get_vm_status.ps1 : Unable to
find type [Microsoft.HyperV.PowerShell.VirtualizationOperationFailedException].
At line:1 char:1
+ &('C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.7.4\plugins\prov ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Hyper...FailedException:TypeName) [get_vm_status.ps1], Ru
   ntimeException
    + FullyQualifiedErrorId : TypeNotFound,get_vm_status.ps1
2015-08-09 12:44:49 -04:00
Seth Vargo 388c2f2383 Merge pull request #5539 from vvchik/vlanid
HyperV provider: VlanID configuration possibility
2015-05-30 11:46:43 -07:00
Seth Vargo 39a1a5c7ba Merge pull request #5207 from mwrock/switch_name
select a Hyper-V switch based on a network_name
2015-05-30 11:45:09 -07:00
Volodymyr Babchynskyy 9a0aab4bd7 Improved behavior for case if vlan_id is not set 2015-03-30 10:17:29 -06:00
Volodymyr Babchynskyy 9e23d16d9c merged vlan_id changes for hyperv by tomassrnka 2015-03-30 08:37:29 -06:00
ssugar fd557592d4 only set EFI secure boot for gen 2 machines in hyperv provider 2015-03-30 20:00:16 +07:00
Tomas Srnka 21e2f33fb0 Fix for: [hyperv]: VM import process does not respect Secure Boot option from image #5209 2015-01-17 21:31:37 +01:00
Matt Wrock 87195f8336 use :bridge instead of network_name to align with site docs 2015-01-17 11:39:32 -08:00
Matt Wrock 0b6e65380a select a switch ased on a network_name 2015-01-17 01:06:56 -08:00
Volodymyr Babchynskyy a9ac168b19 Added possibility to configure memory, cpus count, and vmname in vagrantfile 2015-01-14 16:59:01 +02:00
Tomas Srnka 2620042c26 Fix catching "Start-VM" exceptions on Hyper-V during starting up VM 2015-01-04 00:05:50 +01:00
Matt Wrock be75702f35 fixes import for hyper-v generation 2 VMs 2014-08-09 10:30:10 -07:00
Mitchell Hashimoto 2214591bef providers/hyperv: fix double-dot in drive name [GH-4318] 2014-08-08 12:15:03 -07:00
Matt Wrock efd7c619d1 accept vhd as well as vhdx file types on hyper-v 2014-07-17 02:50:51 -07:00
Kalman Hazins bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Takekazu Omi 90ca838174 Just add missing message for destroy command ask N for hyper-v provider.
mitchellh/vagrant#3752
2014-05-12 17:00:59 +09:00
Mitchell Hashimoto a34ee404d8 providers/*: use special NOT_CREATED_ID if not created 2014-05-05 21:52:28 -07:00
Mitchell Hashimoto 35c8504452 providers/hyperv: lower priority for Windows 2014-05-05 21:13:25 -07:00
Mitchell Hashimoto e1e96fac2f providers/hyperv: vagrant ssh_run action [GH-3615] 2014-05-04 17:31:55 -07:00