Forum Discussion

MDH98's avatar
MDH98
Copper Contributor
Jan 25, 2022

Azure Stack HCI move VM from node to cluster

Greetings reader!

 

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?

 

Here is my github repo with my current code, keep in mind this is still work in progress 🙂

https://github.com/MDH1998/AzureStackHCI/tree/master

 

When I deploy my virtual machine to my node I can see it in my virtual machine tab in my node but not in my cluster.

 

On my node:

 

On my cluster:

 

Thanks for taking the time to read my post and feel free to answer!

Kind regards, MDH98

 

1 Reply

  • MDH98's avatar
    MDH98
    Copper Contributor
    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/