Migrating AWAY from Virtual Machine Scale Sets

Charl Fourie 1 Reputation point
2024-10-09T12:16:08.5833333+00:00

Hoping anyone can help me, we have had a situation where someone deployed a virtual machine in a virtual machine scale set, we would like to move to a basic azure virtual machine but I don't really see how to do this with a VMSS image,

Does anyone have some documentation or how-to? I looked everywhere.

Regards

Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
414 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Marcin Policht 26,620 Reputation points MVP
    2024-10-09T12:26:15.8+00:00

    You cannot directly "move" a VM from a VMSS, as VMSS instances are managed differently from individual VMs. However, you can capture the VMSS image and use it to create a new standalone VM. Here's a high-level guide on how to do this:

    • Steps to Move from VMSS to a Standalone Azure VM:
      1. Capture the VMSS Image:
        • Identify the VM instance you want to replicate as a standalone VM.
        • Deallocate and generalize the VM (similar to capturing an image of a regular VM).
                  az vmss deallocate --instance-id <instance-id> --resource-group <resource-group> --name <vmss-name>
          

    az vmss generalize --instance-id <instance-id> --resource-group <resource-group> --name <vmss-name> ```

      - Capture the image:
      
        ```azurecli
        az vm image create --resource-group <resource-group> --name <image-name> --
        ```
        
    
    1. Create a Standalone Virtual Machine:
      • Once the image is captured, you can create a new VM using the captured image:
                az vm create --resource-group <resource-group> --name <new-vm-name> --image <image-name> --admin-username <username> --authentication-type <password/ssh>
        
      • During VM creation, you can specify any required size (e.g., a basic VM size).
    2. Configure the New VM:
      • After the VM is created, configure it as needed (networking, disks, public IP, etc.).
      • Attach or reconfigure any necessary data disks or other resources that were attached to the VMSS instance.

    Considerations:

    • Data Disks: If your VMSS instance had data disks, you need to ensure those are properly moved or reattached.
    • Availability: The VM created from the VMSS image will be standalone, so ensure you account for the loss of automatic scaling and load balancing features from the VMSS.
    • Scaling: Once converted to a basic VM, scaling and management will need to be handled manually.

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    0 comments No comments

  2. TP 99,531 Reputation points
    2024-10-09T13:28:09.8633333+00:00

    Hi Charl,

    In addition to the information provided by Marcin above.

    Subject to limitations, you may Detach the VM from the VM Scale Set. To do this you would navigate to the VM -- Availability + scale -- Availability + scaling blade and click Detach from the VMSS.

    User's image

    After detaching the VM you should verify that its networking configuration is as desired in terms of load balancing/public IP and make changes as needed.

    Please click Accept Answer and upvote if the above was helpful.

    Thanks.

    -TP


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.