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 a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND