I have a powershell script that creates virtual machines on one of my nodes in my Azure Stack HCI cluster and I was wondering if there are powershell commands for deploying my virtual machine onto my cluster? Or is there a way in powershell so that I can move my virtual machine from my node to the cluster? Everything is managed in Windows Admin Center, here I can see my nodes of the cluster and the cluster itself and where I can manage everything.
currently I deploy my virtual machine to one of my nodes in the cluster. I see the VM under the VM tab in my node but not in my cluster. When creating the VM it says in my output in powershell "IsClustered : False" but I can't find a way to change this. My goal is to find a way in powershell to deploy a VM in my Azure Stack HCI cluster instead of my node itself which, because when deploying onto the node it does not show the VM in my cluster.
Here is my github repo with my current code, keep in mind this is still work in progress :) MDH1998/AzureStackHCI at master (github.com)
Thanks in advance!
Solution: Add-ClusterVirtualMachineRole -Name $VMName -VirtualMachine $VMName -Cluster $ClusterName
All credit to SnaketheJakem on Reddit: https://www.reddit.com/r/PowerShell/comments/scwnry/azure_stack_hci_move_vm_from_node_to_cluster/