Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SOLVED] ERROR CREATE VM BY CLI #406

Open
EKI-INDRADI opened this issue Oct 9, 2024 · 2 comments
Open

[SOLVED] ERROR CREATE VM BY CLI #406

EKI-INDRADI opened this issue Oct 9, 2024 · 2 comments

Comments

@EKI-INDRADI
Copy link

EKI-INDRADI commented Oct 9, 2024

ERROR FROM CopyFilesToVM.ps1 line : 4373

CLI DETAIL VERSION :

(Get-VMHostSupportedVersion).Version | Where-Object {$_.Major -lt 254}| Select-Object -Last 1

response

Major  Minor  Build  Revision
-----  -----  -----  --------
9      2      -1     -1

CLI :

New-VM -Name $VMName -MemoryStartupBytes $MemoryAmount -VHDPath $VhdPath -Generation 2 -SwitchName $NetworkSwitch -Version $MaxAvailableVersion | Out-Null

same as

New-VM -Name testcreatevm -MemoryStartupBytes 4 -VHDPath "G:\NEW_VM_2024\VM\" -Generation 2 -SwitchName "HYPER_V_BRIDGE" -Version ((Get-VMHostSupportedVersion).Version | Where-Object {$_.Major -lt 254}| Select-Object -Last 1) | Out-Null

ERROR DETAIL:

New-VM : Failed to create a new virtual machine.
'testcreatevm' failed to realize. (Virtual machine ID A22D2BC7-40BE-41AC-B8A5-CB03570C6FB0)
Failed to access configuration store: The system cannot find the path specified. (0x80070003).
At line:1 char:1
+ New-VM -Name testcreatevm -MemoryStartupBytes 4 -VHDPath "G:\NEW_VM_2 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [New-VM], VirtualizationException
    + FullyQualifiedErrorId : ObjectNotFound,Microsoft.HyperV.PowerShell.Commands.NewVM

ERROR CLI

 New-VM

RESPONSE

New-VM : Failed to create a new virtual machine.
'New Virtual Machine' failed to realize. (Virtual machine ID 77BE1E27-D6FD-4A03-9433-9FC2E8A16B2E)
Failed to access configuration store: The system cannot find the path specified. (0x80070003).
At line:1 char:1
+ New-VM
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (:) [New-VM], VirtualizationException
    + FullyQualifiedErrorId : ObjectNotFound,Microsoft.HyperV.PowerShell.Commands.NewVM
@EKI-INDRADI
Copy link
Author

EKI-INDRADI commented Oct 9, 2024

SOLVED

  1. Hyper-V Settings, Makesure all directory valid
EXAMPLE : 

VD
G:\NEW_VM_2024\VD

Virtual Machine
G:\NEW_VM_2024\VM 
  1. PowerShell Execution Policy:
   - If you are running the command in a PowerShell script, make sure that the execution policy allows it. You can check this by running `Get-ExecutionPolicy`. If it’s set to `Restricted`, you may change it with `Set-ExecutionPolicy Unrestricted`.
  1. and test run CLI
New-VM
Name                State CPUUsage(%) MemoryAssigned(M) Uptime   Status             Version
----                ----- ----------- ----------------- ------   ------             -------
New Virtual Machine Off   0           0                 00:00:00 Operating normally 9.0

@EKI-INDRADI
Copy link
Author

DONE

@EKI-INDRADI EKI-INDRADI changed the title ERROR CREATE VM BY CLI [SOLVED] ERROR CREATE VM BY CLI Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant