How to upgrade an azure VM? I have a VM in azure. As I was looking at the bill I realized it is not an RI - Reserved instance. With a reserved instance prices can be half to a third. So I wanted to convert this VM to a 3 year reserved instance. By their cost calculator that will come to about 300 dollars for 3 years.
However when I tried to upgrade the VM (They call it resize), I have realized this is an older VM and I am not able to reserve it for 3 years. So this article goes into how to find a suitable VM that can be reserved for 3 years and how do I migrate my OS disk and the data to this new VM
In addition the VHD (hard disk) I had seemed to be a nonmanaged disk. I needed to convert that to a managed disk as well. this article will go into that as well with some useful reads from microsoft azure site.
satya - 8/6/2019, 5:58:39 PM
How to upgrade an azure VM?
How to upgrade an azure VM?
satya - 8/6/2019, 6:42:10 PM
So the difficulties
I go to the reservations blade but I don't see the VM type: Basic A1 (1 vcpus, 1.75 GiB memory).
Looks like this is an expired VM and needs to be upgraded
Upgrading a VM seem to be known as "resizing" the VM while the virtual machine blade (panel) is open.
However the VMs shown don't match the VMs that are in the "reservation" bucket.
So I submit a case
I was advised to look at the pricing calculator (which is a nice feature) and I pick a VM. Not all VMs have the 3year option. I managed to find one. I send that to the case folks and see what happens.
My question now is, how do I change my old VM to the new VM while I keep my previous hard drive intact so I don't have to install new software.
And the previous disk says it is an "unmanaged", not sure what that means either.
Perhaps if the VM that is listed as "reservble" had been located in the "size" panel i suppose it would have been easier.
satya - 8/7/2019, 9:59:06 AM
I have Azure Storage explorer installed on my local laptop
Not sure yet how to use this one and for what. I am able to browse through storage account and see a few "VHD" instances under Blob containers. That makes me wonder the structure of a storage account.
satya - 8/7/2019, 10:02:04 AM
What is an azure VHD?
What is an azure VHD?
satya - 8/7/2019, 10:02:17 AM
What is an azure VHD Snapshot?
What is an azure VHD Snapshot?
satya - 8/7/2019, 10:07:14 AM
Storage explorer
satya - 8/7/2019, 10:08:43 AM
Notice how the storage account has many disks and other stuff....
So it is not a hard drive by itself. wonder how the hard drive is then associated with the VM???
satya - 8/7/2019, 3:18:35 PM
In azure, How to attache a managed disk as OS disk to the virtual machine
In azure, How to attache a managed disk as OS disk to the virtual machine
Search for: In azure, How to attache a managed disk as OS disk to the virtual machine
satya - 8/7/2019, 3:20:42 PM
How do I know if a VHD is an OS disk?
Open the storage explorer
Go to blob containers
Locate the VHD
See the tabular properties of that VHD
There is a column called "Disk Type"
This column shows "OSDisk"
satya - 8/7/2019, 3:21:18 PM
what is a leased VHD in azure?
what is a leased VHD in azure?
satya - 8/7/2019, 3:30:46 PM
There is a lot of information on storage accounts and VHDs at this blog
There is a lot of information on storage accounts and VHDs at this blog
satya - 8/7/2019, 3:34:20 PM
Key points are
The word "leased" next to a VHD means it is being used by another service such as a VM
The column VM Name for that VHD will indicate the name of the VM that is using the disk
The column "Disk Type" shows whether it is an OS disk or a data disk
There seem to be some differences between managed and unmanaged disks.
satya - 8/7/2019, 3:40:44 PM
The VHD ribbon in the storage explorer looks like this
satya - 8/7/2019, 3:52:41 PM
So what are managed disks
An Azure managed disk is a virtual hard disk (VHD).
Azure managed disks are stored as page blobs, which are a random IO storage object in Azure.
A managed disk is ?managed? because it is an abstraction over page blobs, blob containers, and Azure storage accounts.
Data disk: A data disk is a managed disk that's attached to a virtual machine to store application data, or other data you need to keep. Data disks are registered as SCSI drives and are labeled with a letter that you choose.
The size of the virtual machine determines how many data disks you can attach to it and the type of storage you can use to host the disks.
OS Disk: Every virtual machine has one attached operating system disk. That OS disk has a pre-installed OS, which was selected when the VM was created.
Temporary disk: Every VM contains a temporary disk, which is not a managed disk. The temporary disk provides short-term storage for applications and processes and is intended to only store data such as page or swap files. Data on the temporary disk may be lost during a maintenance event event or when you redeploy a VM. On Azure Linux VMs, the temporary disk is /dev/sdb by default and on Windows VMs the temporary disk is D: by default. During a successful standard reboot of the VM, the data on the temporary disk will persist.
satya - 8/7/2019, 3:56:10 PM
Snapshot or an Image to create a new VM?
A snapshot is a copy of a disk at the point in time the snapshot is taken. It applies only to one disk. If you have a VM that has one disk (the OS disk), you can take a snapshot or an image of it and create a VM from either the snapshot or the image.
satya - 8/8/2019, 1:48:01 PM
How to change a VM so that the new VM can be reserved for 3 years?
1. Use Reservation service to look for a VM that is eligible for 3 years and has the right size. You need this info because when you try to resize the VM through the Portal you need to recognize this particular VM. (Not all VMs may be available in the options list)
2. Stop the current VM. This is because the available VMs to resize to seem to differ when it is running and when it is not running!! Don't know why. but so is the case. So stop the VM
3. Now locate the VM that you saw in reservations in the available VM list. If you don't see it, you cannot use this option. If you do see it, pick it up and resize the VM through the portal.
4. This may take 10 minutes for the network ips to reset etc. On my previous VM my ip is a static IP. If it were not a static IP I am not sure how you go about doing it. I mean you will get the new VM but it will have a different public IP if the original ip was not a static ip. If the original ip was a static ip, it seem to keep it.
5. This process also seem to add a number of things into that resource group. I haven't paid attention as to what the new entries are!
satya - 8/8/2019, 1:55:08 PM
Where is the reservations menu/service
satya - 8/8/2019, 1:56:18 PM
Invoke the reservation service
You can click "+add" to look or add a new reservation, be it a VM or SQL Server etc. Not every service is available.
satya - 8/8/2019, 1:57:20 PM
Here is the how you get to VMs
satya - 8/8/2019, 2:00:54 PM
Here is what you see when you invoke Buy from above to get into available VMs
Notice the availale scope options for the reservation to apply. In my case my VM is in a resource group. I do not know how to apply this reservation against "one VM" that I want to buy for 3 years. This is the closest scope I could get to. Hopefully the reservation will look for a matching VM size and apply the billing correctly.
satya - 8/8/2019, 2:05:10 PM
Here is the rest of that image where you see the resource group and also the available VMs
Notice the selected resource group. Also notice the filter "b" to get to the VMs named basic "standard_b*". Choose the right region and the term of 1 year or 3 years. Now when you choose that row, it will calculate the price for the term at the bottom. On the next page it will allow you to buy the number of units. Hopefully this number of units will let you decide how many of the VMs in that resource group are billed with that 3 year frequency. It is a puzzle however as to what if there are many VMs with that spec in that resource group?
satya - 8/8/2019, 2:09:06 PM
Next problem: my previous VHDs are unmanaged. To convert them to managed
1. Go to portal
2. Locate the VM
3. Go to disks
4. Choose migrate to "managed disks"
5. This will stop, migrate the disks, and restarts the VM. It will apparently leave the original unmanaged VHD intact (for you to keep or delete afterwards)
6. Official documentation suggests to do this only in a test mode and then eventual swap it into production. In my case I just took a chance. Seem to work
7. However I have not investigated what changes were also made to the resource group after this operation.
8. This will take sometime based on the disk size
satya - 8/8/2019, 2:12:10 PM
Read this microsoft doc on converting a VM to use managed disks
Read this microsoft doc on converting a VM to use managed disks
satya - 8/8/2019, 2:13:25 PM
Here is that "disks" menu what it looks like after conversion
satya - 8/8/2019, 2:18:26 PM
Here is what the resource group is like and see how the managed disk shows up at the root level now
Previously this disk is inside the "storage account".