Reputation: 23214
If I deploy a virtual machine image to windows azure. Will the virtual machine be able to keep state or will it be reverted to the original state sometimes?
e.g. if the virtual machine hosts sql server (e.g. to enable full text serach which is not present in sql azure) is there a chance that I lose my data sometimes then?
Upvotes: 1
Views: 699
Reputation: 25200
(EDIT -- this answer was relevant for the PaaS style of Azure deployments; the new IaaS virtual machines do have persistent storage. See http://michaelwasham.com/2012/06/08/understanding-windows-azure-virtual-machines/ for more details)
No, the virtual machine will not, officially, keep any state at all. In theory a new virtual machine could be created and your traffic routed to that new instance without your knowledge, for example after a patch update or anything else for that matter.
So use AzureBlobDrive or table storage or SQL Azure if you want to store something that won't go away.
In practice, however, Azure instances currently have three drives:
On a fresh deployment or a "reimage" these three drives are created from scratch.
On a reboot, however, it seems that C: and D: stay as they were, but the drive with your application is reset.
On an upgrade deployment things get interesting. Drives C: and D: stay unchanged, but after the host is taken offline by the load balancer a new drive F: is created with the new version of the application. Your IIS instance is reset to point to this new drive, then the old drive E: is removed, then the load balancer reconfigured to bring the host back on line. At the next upgrade your application will swap back to drive E:.
The advantage of this is that upgrades don't take nearly so long as full deployments. The downside is that changes to IIS configuration (e.g. endpoints, certificates) can't be done with an upgrade but need a full deploy instead.
So in practice it can be feasible to temporarily store data on C:, for something like logging. But don't rely on it.
Upvotes: 5
Reputation: 2353
The disks on a VM role are not durable. When the instance transitions (i.e. the OS moves from one machine to another) you're back to square one.
You could mount a VHD drive to persist data, however only one instance can write to the drive.
BTW, using a VM role to host a SQL Server is a bad idea, use SQL Azure.
Upvotes: 0