microsoft / MSLab

Azure Stack HCI, Windows 10 and Windows Server rapid lab deployment scripts
MIT License
1.18k stars 284 forks source link

Guest VM clustered option #494

Closed DillyBabu closed 2 years ago

DillyBabu commented 2 years ago

Hi, While I am deploying a new VM using admincenter, the new VM is created as 'Clustered'. But, when trying from powershell I am only able to select a node and deploy a VM in it. I am using the following command. New-VM -ComputerName "node01" -Name "guestvm1" -MemoryStartupBytes 4GB -VHDPath "C:\Clusterstorage\Volume01\VHD's\guestvm1.vhdx" -Path "C:\ClusterStorage\Volume02\VMS\" -Generation 2 -SwitchName "Mgmt_vmSwitch" ` -ErrorAction Stop Instead of "node01" in the above command, I tried with cluster name "cluster1". It doesn't allow me to login. guestvm clustered

Is this because of no power shell option available in the cluster manager tools section? Kindly guide me. Thanks!

jaromirk commented 2 years ago

Yeah, after creating VM you need to add it as clustered resource

    #add VM as clustered role
    Add-ClusterVirtualMachineRole -VMName $VM.VMName -Cluster $ClusterName

More info here https://github.com/microsoft/MSLab/tree/master/Scenarios/S2D%20and%20Bulk%20VM%20creation