Commit graph

28 commits

Author SHA1 Message Date
oss-core-libraries-dashboard[bot]
73228596f4
[COMPLIANCE] Update Copyright and License Headers (Batch 3 of 7) (#13763)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2025-12-22 16:46:39 +05:30
g0tmi1k
d3a14babf1
Fix HyperV XML: System.Xml.XmlElement & The minimum amount (#13691)
* Fix HyperV XML: System.Xml.XmlElement & The minimum amount
2025-07-18 12:10:36 +05:30
Chris Roberts
0269a47f24
Add resource parameters for hyperv xml import
The generic import cmdlet passes all received arguments to
the specialized import cmdlets. The resource parameters for
providing memory and cpu values were added to the vmcx based
cmdlet but not the xml based cmdlet. This adds the to the
xml based cmdlet and includes configuration adjustment if set.
2025-05-22 15:33:43 -07:00
Chris Roberts
6a0f875833
Fix hyperv import failure due to lack of resources
When importing a box that was built with more resources than is
available on the current system, import would fail. If the memory
and/or cpu values are set in the Vagrantfile configuration, provide
them when importing the guest. This allows the values to be modified
prior to registering the new guest preventing a resource unavailability
error.

Fixes #12180
2025-05-20 18:10:49 -07:00
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
Chris Roberts
2696c3d74d Import the security module for access check
The 7.3.0 release of powershell cleaned up some stray things that
should require the import of the security module to be available.
It causes issues with pre-7.3 versions of powershell that attempt
to load the newer module so we run a check and restrict the module
version based on the powershell version.
2022-11-22 11:05:18 -08:00
sophia
e3223b67ff Fix if statement to use '-and' syntax
Docs for powershell:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_logical_operators?view=powershell-7
2020-08-07 17:24:49 -05:00
Chris Roberts
64490299c3 Include check for support of the SecureBootTemplate parameter 2020-07-28 15:10:57 -07:00
Stephan Wild
4ff1ff5bc0 Set secure boot template setting for hyperv 2020-07-10 20:38:32 +02:00
Sophia Castellarin
1a45f302e3
Merge pull request #11499 from soapy1/hyperv-integrationservice-non-ascii-names
Use service id for enabling/disabling vm integration services
2020-04-17 09:53:35 -04:00
sophia
d5cd4da0e0 Use service id for enabling/disabling vm integration services
ref:
https://github.com/PlagueHO/LabBuilder/issues/183
ref service name to id:
https://social.technet.microsoft.com/Forums/de-DE/154917de-f3ca-4b1e-b3f8-23dd4b4f0f06/getvmintegrationservice-sprachabhngig?forum=powershell_de
2020-04-13 09:39:53 -04:00
ibrahim.dursun
fb8180a843
Fix #11271: catch IdentityNotMappedException
Some IdentityReferences cannot be translated to
[System.Security.Principal.SecurityIdentifier] because they don't map to
a SecurityIdentifier.

An example is:
IdentityReference : APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES

In such case, it is better to catch the exception and treat it as $false.
2020-03-03 15:57:21 +00:00
Matt Shanahan
6caa7bfa86 Fixes issue hashicorp#10973: checks that VMMS WMI reference is null & throws appropriately 2019-07-19 07:48:03 +02:00
Chris Roberts
83ed01869d Ignore errors when generating new VM configuration
The default error action is to stop. When generating the initial
VM configuration during import, if the Compare-VM command fails
it results in a generic error message. Instead the error should
be ignored so the source VM can be inspected and a useful error
message can be returned to the user.
2018-11-13 12:21:17 -08:00
Chris Roberts
9c149ba8b1 Only enable ExposeVirtualizationExtensions if available within Hyper-V version 2018-07-31 13:33:41 -07:00
Chris Roberts
15dacc80c0 Update ACL check to use identifier to prevent localization errors 2018-07-06 16:25:05 -07:00
Chris Roberts
101fc447ec Add Hyper-V access check on data directory 2018-06-18 15:36:45 -07:00
Chris Roberts
a8abb6898c Fix PowerShell cmdlet name for clones 2018-06-18 09:09:01 -07:00
Chris Roberts
8fbf27772a Always ensure full path to configuration file on import 2018-06-15 07:48:14 -07:00
Chris Roberts
694104b005 Attempt to provide helper error message on failed VM import
When importing a Hyper-V VM fails, attempt to manually build
a system definition and inspect the result to determine cause
of the failure.
2018-06-14 16:40:37 -07:00
Chris Roberts
3919455f08
Merge pull request #9932 from chrisroberts/e-hyperv-maxmem-chk
Validate maxmemory setting within Hyper-V provider
2018-06-13 14:52:09 -07:00
Chris Roberts
4d3f5d33c6
Merge pull request #9925 from chrisroberts/u-powershelling
Misc. PowerShell cleanup
2018-06-13 14:51:43 -07:00
Chris Roberts
9482f351fc Validate maxmemory setting within Hyper-V provider
Forces an error if maxmemory value is less than the configured
minimum or startup memory.

Fixes #9477
2018-06-13 13:27:11 -07:00
Chris Roberts
1554f447f2 Disconnect all configured network adapters
When importing a Hyper-V VM ensure all adapters are disconnected from
switches that were used when the box was built.
2018-06-13 07:59:56 -07:00
Chris Roberts
57842d7269 Update powershell messaging functions to not include second - character. 2018-06-12 16:47:47 -07:00
Chris Roberts
52bae21933 Remove unused PowerShell scripts 2018-05-24 15:33:36 -07:00
Chris Roberts
e6457d5061 Overhaul the Hyper-V provider 2018-05-24 14:43:44 -07:00
Mitchell Hashimoto
ca24d60d8f providers/hyperv: initial commit
Initial work done by MS Open Tech
2014-02-27 08:12:46 -08:00