Is it possible to start a VM inside a WorkerRole? - azure

I have a little OS that I'd like to start and use in Azure and thought about running a VM inside a WorkerRole. I know it is possible to use Azure VM roles for that but my exercise is to run it from inside a Worker/WebRole. Is that possible?
I tried installing VirtualBox and running that in a WorkerRole but when running the OS my WorkerRole just reboots.
Any help appreciated.

You cannot run a VM inside a VM in Azure. A Worker Role (or instances of a Worker Role) are already Windows Server 2008 / 2012 VMs. As #Robert pointed out, Azure has support for Virtual Machines, whether Linux or Windows, where you have complete control of its contents.
Regarding I have a little OS that I'd like to start: You can only run supported OS's that are listed in the Virtual Machine gallery: Ubuntu, CentOS, Windows Server, SUSE currently. More info on Linux VMs here, Windows Server here.

What you are trying to do is not technically supported by Microsoft and is not recommended (even if you could easily) since Azure is constantly taking down and bringing back up your Web/Worker role instances in a deployment.
This means that any manual changes made to your WorkerRole will be undone any time Azure bounces your deployment (i.e. data center issues, migrations, etc.) This happens much more often than you'd think.
You should check out Azure's VM support which may have what you need.

Related

Azure CosmosDB on Linux

is there a way I can run a CosmosDB emulator on a Linux machine? I need to setup a development environment for Azure Functions projects. There is a solution for storage (Azurite), I wonder I can find the same for CosmosDB.
(Running a virtual machine is not an option for this case)
The short answer: Today you need a Windows VM to run the Emulator on Linux or any non-Windows platform. We publish a docker image which runs in Windows containers and they aren’t supported on Linux. We’re actively looking at the possibility of a port but that work is at an early stage.

redeploy of worker role should not change the VM

i have one application which requires lot of setting to run the worker role
i have concern on the when we redeploy the worker role will it change the VM...?
if it change the VM then all the VM related setting file are need to be re-installed and reconfigured. I am trying to install the FFMPEG on the VM where the worker role will be installed
Worker roles in Windows Azure are essentially Stateless Virtual Machines. What that means is that any changes you make after the VM is deployed will be lost when new code is deployed (this would include installing software by connecting to the the VM via RDP) or the VM is recycled.
I would recommend doing the installation of the software you need in the worker role using Start Up Tasks. This way the software you wish to install are part of your deployment package and Windows Azure will install the software (and other tasks defined in start up tasks) before the role starts.
You should always assume that your worker role's VM will change unexpectedly. Any OS configurations you depend on should be part of your worker role's installation process via startup scripts and never be done manually.
Why?
When you upgrade, the VM may change depending on how you upgrade.
The physical hardware that your VM runs on may experience a failure (or upgrade) and can go down at any moment. In many of these cases, Azure will provision a new VM and install your worker role to it and bring it up.
Operating Systems routinely have updates installed on them and these may trigger the above-mentioned scenario.

Can I use a windows image as a guest OS for Azure WebRole?

I have this situation where I need to install and configure various things in the OS. I know that I can use VMs for this, but I need the code deployment functionality and wonder if there is a way to have a custom OS image and also be able to do code deployments using visual studio publish.
Custom OS images is not option for Web/Worker roles (i.e. True PaaS Cloud Services). However you add OS customizations via a Startup Task. I can hardly think of anything that is not possible via a startup task.

Existing machine (vhd) as an image for creating multiple VM instances

I have an existing VM with a configured Sharepoint environment. I would like to use this machine as a base for creating multiple azure VM instances for several developers to work on. Is such scenario possible? Is running 'sysprep' (will ruin my sharepoint) unevitable?
I would also be able to upgrade the 'image' (e.g. install windows updates) and create VM's from it afterwards.
How can I achieve this? I know cloudshare offers similar solution, so I suppose it also can be done in azure.
You certainly can make an image from a Virtual Machine. The entire process is described here. Also look at my other SO answer about a caveat when running sysprep (regarding not letting the VM image shut down after sysprep runs).
Once you have your image, it will be available in your Virtual Machine gallery, where you can choose it as your baseline for new VMs (either via portal or PowerShell / CLI).
If, in the future, you do updates on your master image, you'd need to re-create an image for future deployments. Or... you'd need to install the updates on each deployed VM instance.
Note: With web/worker role instances (which doesn't help for SharePoint but could help with other workloads you have), the Windows Server OS image is maintained by Microsoft. Should there be an OS update, these are taken care of for you.

Azure Guest OS Family upgrade 2008 to 2012, will deployed apps still work?

I would like to upgrade the "OS Family" of my Azure Cloud Service (Web Role) from "Windows Server 2008 R2" to "Windows Server 2012", so that I have .Net 4.5 available. There is a dropdown in the Azure Portal to make this change, but I am concerned with what kind of outage this may result in... will my deployed website still be active and functional during/after this change?
This is the best documentation I have been able to find and it doesn't mention what behavior I can expect:
http://msdn.microsoft.com/en-us/library/windowsazure/gg456324.aspx
So it is understood how Web Roles function, when you upload your application with configurations, Azure saves the uploaded data separate from any virtual machines. A subsequent deployment of the uploaded application includes creating a brand new virtual machine of your choice (e.g., small, medium,....). There are separate virtual machines for different Operating Systems. Once a predefined type virtual machine is provisioned, your app is loaded on the provisioned virtual machine and virtual machine is then started (it is possible that the deployment takes place after starting the VM). So now, going to back your question, if you change the settings from OS 2008 to OS 2012, it is obvious that the old VM would be de-provisioned and a new VM with OS 2012 is provisioned, your app deployed, etc. Hence, there will be a downtime. My experience is that it takes about 5 minutes or so to make this transition.
If you change the OS family all the roles and the instances will experience the downtime. This is because OSFamily is part of Services Configuration which is the setting for overall application. If you have only Web Role or Worker Role or both in your Azure application changing this setting will applies to all roles and there instances.
Once the configuration changes are applied to the application, the whole services gets updated. Think like this way, if you have multiple instance to a Role, you don't want to run half instance with new configuration and half older configuration, as this may create big problem. So updating application configuration required does required downtime. There is already staging and production slot based deployment available to reduce downtime.
If you want to avoid down time you can do the following:
While your production application already running, deploy your new application with OSFamily=3 (Windows Server 2012) to staging slot
Test staging application as needed
Once your staging application works as expected do "VIP SWAP" at the portal.
VIP swap will push your staging deployment to production and within less then second you will have application running with Windows Server 2012.

Resources