Hello @Pablo Ruano .
Welcome to the MS Q&A forum.
As I understand you are looking for a steps to customize OS disk size. From what I know, the OS disk size is based on the image. It’s not possible to create a VM with 64GB OS disk from an Azure Marketplace Image that was created using a 128GB volume. When you create a new virtual machine (VM) in a resource group by deploying an image from Azure Marketplace, the default operating system (OS) disk is usually 127 GiB (some images have smaller OS disk sizes by default). To get an image for some specific size, it should be published by the Publisher on the Azure Marketplace. As example, Windows Server small disk images come with 30GB OS disks. Officially shrinking an existing disk isn’t supported and may result in data loss.
As a workaround, you can create a VM on your local Hyper-V, create it with a small disk, then upload it to Azure, then use this VHD to create new VM, in this way, the VM's OS disk will smaller than 30GB.
Sharing few resources for your reference:
- Prepare an Ubuntu virtual machine for Azure
- How to shrink the size of an Azure Cloud image from cloud-images.ubuntu.com?
Hope above answers your questions and concerns.
--------------------------------------------------------
Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.
Sincerely,
Olga Os