How to clone a VM in AZURE easily to create a new similar VM
I am explaining the easiest method when you wanted to clone an existing VM and create a copy from it through Azure Portal
Note: The following steps are applicable to an existing VM with only OS disk attached. Also the steps are performed for a CENTOS 7.8 Linux VM
STEP1: Create a snapshot of the disk. Go to the VM and click Disk
STEP2: Select the Disk
STEP3: Create Snapshot. You may go with default values. Just provide a name for the snapshot
STEP4: Create a Disk from the snapshot. Select the snapshot just created and click Create Disk. Create with default values and preferred name
STEP5:Create VM. Select the Disk created and start Creating the VM. In the Create VM page you will see the Image Name (Disk Name) we just have created
Note: You may need to select/Unselect some of the preferences like Monitoring, Auto Shutdown. Also, add tags if needed. Rest all settings can be default values
STEP6: Login to the VM
(Follow the steps only if you need to login the cloned VM using username and password)
I have setup the existing VM to Login with root user and password (without using any ssh authentication). But the cloned VM can’t go with root user and password from the existing VM. So, login the cloned VM using the ssh key and et the following value in /etc/ssh/sshd_config
PasswordAuthentication yes
Hit a sshd restart (service sshd restart). Also, you may set a new hostname (/etc/hostname)
Now your cloned VM is ready to login using username and password too
4 Responses
Thanks for article.
Good day sir I wish to create a Export users list from Azure AD Group. And I want to Create a Windows Server Virtual Machine in Microsoft Azure using PowerShell script
Export Users list from Azure AD Group>
Go to ‘Azure Active Directory’ blade and select the group you are interested in. Select ‘Members’ from the ‘Manage’ section. Under ‘Bulk Operations’ select ‘Download Members’ to download the list of members in the group
Create a Windows Server in Microsoft Azure using PowerShell>
You can check the article I posted in this forum as below
https://www.cloudcompute.info/create-a-windows-server-virtual-machine-in-microsoft-azure-using-powershell-script/
Thanks this article help me so much