2

I am trying to deploy a nodejs app on azure vm but I keep reading that the vm machine can crash or restart.

So lets say I opened the vm and installed nodejs and all the required tools I need then I get my code from github and started it, now every thing is running okay.

I am wondering what would happen if the vm restarted/crashed? Will the tools I downloaded and my code be lost? how can I make the vm when it start to redownload the tools, setup the environment, download my code then run it?

1 Answer 1

1

Azure Virtual Machines use Azure Blobs to back the OS disk VHD, as well as any attached data disk VHD. So, for those disks, everything is durable, regardless whether the VM is running or not (or crashes).

VMs also provide temporary storage on ephemeral disks. Assume anything placed on these temporary disks can, and will, disappear upon crash/restart.

So if you install any type of code libraries, apps, etc. on OS or attached disks, things remain in place unless you decommission the VM (and related storage), or delete it yourself.

Lots of documentation around Azure Virtual Machines and Storage, which can provide additional details.

Sign up to request clarification or add additional context in comments.

2 Comments

So it is safe to install my tools and code on the main disk and it will be presisted right, even the database and its data? even if the vm relocated to other node.
Yes - os and data disks are network-attached (except for temp disks, as I explained).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.