Lab10 - Capturing existing VM _ build new VM with customized Image using Managed Disks - Azure
Lab10 - Capturing existing VM _ build new VM with customized Image using Managed Disks - Azure
Managed disks
You can also manage your custom images in one storage account per Azure region, and
use them to create hundreds of VMs in the same subscription. For more information
about Managed Disks, see the Managed Disks Overview.
We recommend that you use Azure Managed Disks for new VMs, and that you convert
your previous unmanaged disks to managed disks, to take advantage of the many
features available in Managed Disks.
Images
Managed Disks also support creating a managed custom image. You can create an image from your
custom VHD in a storage account or directly from a generalized (sys-prepped) VM. This process captures
in a single image all managed disks associated with a VM, including both the OS and data disks. This
managed custom image enables creating hundreds of VMs using your custom image without the need to
copy or manage any storage accounts.
Page 1 of 71
Cloud Computing - Azure
Topology
Page 2 of 71
Cloud Computing - Azure
Page 3 of 71
Cloud Computing - Azure
Click “Add”.
Page 4 of 71
Cloud Computing - Azure
Page 5 of 71
Cloud Computing - Azure
Page 6 of 71
Cloud Computing - Azure
In “Virtual networks”
Click “Add”.
Page 7 of 71
Cloud Computing - Azure
Page 8 of 71
Cloud Computing - Azure
Click “Create”.
Page 9 of 71
Cloud Computing - Azure
Page 10 of 71
Cloud Computing - Azure
In “Virtual machines”.
Page 11 of 71
Cloud Computing - Azure
Page 12 of 71
Cloud Computing - Azure
In “Administrator Account”
In Password type the password for the Ubuntu server to access through SSH.
Page 13 of 71
Cloud Computing - Azure
Because I am going to install apache web server in Ubuntu and capture the Ubuntu VM as Image, then
build a new VM with customized or captured image.
Page 14 of 71
Cloud Computing - Azure
Page 15 of 71
Cloud Computing - Azure
In “Disks”
Page 16 of 71
Cloud Computing - Azure
Page 17 of 71
Cloud Computing - Azure
In “Networking”
Page 18 of 71
Cloud Computing - Azure
Page 19 of 71
Cloud Computing - Azure
In “Management”
Page 20 of 71
Cloud Computing - Azure
In “Guest config”.
Page 21 of 71
Cloud Computing - Azure
Page 22 of 71
Cloud Computing - Azure
Click “Create”.
Page 23 of 71
Cloud Computing - Azure
Page 24 of 71
Cloud Computing - Azure
Kindly note the public address, we have required to access Ubuntu VM by using this IP only.
Page 25 of 71
Cloud Computing - Azure
Need to launch “Putty”.exe” from local machine and type the IP address of Ubuntu VM in Putty.
Page 26 of 71
Cloud Computing - Azure
Click “Yes”.
Page 27 of 71
Cloud Computing - Azure
Page 28 of 71
Cloud Computing - Azure
Page 29 of 71
Cloud Computing - Azure
Page 30 of 71
Cloud Computing - Azure
Page 31 of 71
Cloud Computing - Azure
Page 32 of 71
Cloud Computing - Azure
Page 33 of 71
Cloud Computing - Azure
Page 34 of 71
Cloud Computing - Azure
Page 35 of 71
Cloud Computing - Azure
Page 36 of 71
Cloud Computing - Azure
Go to Line number “198”, then we have required to delete existing content and replace it as our own
wish.
Page 37 of 71
Cloud Computing - Azure
Page 38 of 71
Cloud Computing - Azure
Page 39 of 71
Cloud Computing - Azure
Then type in bottom line “:wq” and press “Enter” to save the file.
Page 40 of 71
Cloud Computing - Azure
Type public IP address of the Ubuntu in browser and then press “Enter”.
Now you have got the customized web page named as “Sansbound Azure Class Page”.
Page 41 of 71
Cloud Computing - Azure
In “Virtual machines”
Click “Ubuntu-AzureVM”.
Page 42 of 71
Cloud Computing - Azure
In “Ubuntu-AzureVM” you are able see that “Capture” option is available to capture the Virtual
Machine as “Image”. This feature is only available in Managed disks only.
Click “Capture”.
Page 43 of 71
Cloud Computing - Azure
While try to create “Image” it shows are warning message to complete prerequisite to run below
mentioned command in Ubuntu
“waagent –deprovision+user”
Page 44 of 71
Cloud Computing - Azure
In Ubuntu machine,
Page 45 of 71
Cloud Computing - Azure
Press “y” and press “Enter” to delete the home directory data.
Page 46 of 71
Cloud Computing - Azure
Page 47 of 71
Cloud Computing - Azure
In “Ubuntu-AzureVM”.
Page 48 of 71
Cloud Computing - Azure
Page 49 of 71
Cloud Computing - Azure
Click “Create”.
You will get a message once you have successfully captured the virtual machine.
Page 50 of 71
Cloud Computing - Azure
Now, I have required to build a new virtual machine by using Captured image.
Page 51 of 71
Cloud Computing - Azure
Page 52 of 71
Cloud Computing - Azure
In “Image” you have required to select customized image which you have captured by using Managed
disks. So click “Browse all images and disks”.
Page 53 of 71
Cloud Computing - Azure
Page 54 of 71
Cloud Computing - Azure
Page 55 of 71
Cloud Computing - Azure
Page 56 of 71
Cloud Computing - Azure
In “Image” ensure that your customized / own image “Ubuntu-SansWebServer” has been selected.
Page 57 of 71
Cloud Computing - Azure
Page 58 of 71
Cloud Computing - Azure
In “Administrator Account”
Page 59 of 71
Cloud Computing - Azure
Page 60 of 71
Cloud Computing - Azure
In “Disks”
In Advanced, you are able to see it have only “managed disks”. You would not be able to change the
captured image disk as unmanaged disk.
Page 61 of 71
Cloud Computing - Azure
Page 62 of 71
Cloud Computing - Azure
In “Networking”
Ensure NSG type as “Basic” and “Public inbound ports” as “Allowed selected ports”.
Page 63 of 71
Cloud Computing - Azure
Page 64 of 71
Cloud Computing - Azure
In “Management”
Page 65 of 71
Cloud Computing - Azure
In “Guest Config”
Page 66 of 71
Cloud Computing - Azure
In “Tags”.
Page 67 of 71
Cloud Computing - Azure
Click “Create”.
Page 68 of 71
Cloud Computing - Azure
Page 69 of 71
Cloud Computing - Azure
Kindly note the public IP address which you have got for “Ubuntu-SansWebSvr2” virtual machine.
Page 70 of 71
Cloud Computing - Azure
Type public IP address in your local machine browser and then press “Enter”.
We have successfully captured the virtual machine successfully as Image and built new Virtual machine
by using captured image.
When you have deleted the “Resource group” once you have completed the learning purpose lab. Then
Captured Image in Azure has been deleted automatically.
Page 71 of 71