Can u attach azure vm or you can’t attach disks to a running VM?
No, you cannot attach a data disk to an Azure virtual machine that is running. The VM must be stopped before you can attach or detach a data disk. This is because attaching or detaching a data disk involves making changes to the VM’s storage configuration, which can only be done when the VM is not running.
When you attach a data disk to a VM, Azure creates a new disk LUN (logical unit number) and adds it to the VM’s storage configuration. The VM’s operating system then needs to recognize the new disk and make it available for use. This process cannot be done while the VM is running, as it would require the operating system to lock the disk in order to make the changes.
Similarly, when you detach a data disk from a VM, Azure removes the disk LUN from the VM’s storage configuration. The VM’s operating system then needs to release the lock on the disk and make it unavailable for use. This process also cannot be done while the VM is running, as it would require the operating system to lock the disk in order to release the lock.
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals