Changing Azure VM state machine - azure

On an Azure environment can I un-generalized a VM to normal state again that I'll be able to use the VM?
When I try it I have an error message saying that the VM is generalized.
Thanks in advance.
I needed to make a duplicate machine from this VM image, BUT since the machine was created without the options to delete the disks, seems like my option is to make another fresh machine, and change the name of it to something else.
I used this video.
https://www.youtube.com/watch?v=ukqbeiejLYE
But now I would like to use the generalized VM normally, can it be done?

Related

why does "capturing" an image of a VM in Azure prevent the VM from being used?

The Azure portal web interface has several options for creating 'images' of a VM including:
snapshot creates a snapshot of the machine which can presumably be restored or copied (what I am trying to do without much success so far)
capture generalises a VM into an image that can be used to create multiple VMs (in theory)
The capture option makes the original VM unusable. In fact you are prompted about whether you want to keep it as it will no longer run (which indeed it can't).
Why is capture a destructive operation?
When you generalise an image using sysprep it will remove the customisation from your VM and that particular VM be of no use except as a golden image. This golden image then can be used as a template to spin more VM’s by passing on the missing parameters which sysprep removed.
If you like to keep the VM, you are using for capture it is recommended that you make a copy of it first and then use it for capture and sysprep process
Refer below for details
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource
Snapshot is more of a VM state at a given point in time and. Mostly used for migration to another region or to capture a state of an application running the VM before an application upgrade or patch.

Factory reset Windows Server 2016 on Azure

I installed a few beta version of some apps and now the functionality of the Windows is broken.
Is there any way I can reset the windows to it's initial state from the portal or I have to remove it and create a new one?
If you have not backup this VM or take a snapshot of this VM, we should re-create a new VM.
As mentioned by Jason, if a backup or a snapshot was taken, you could use them to recover the VM.
You have mentioned, ‘now the functionality of the Windows is broken’, unsure if you are facing some boot issue or something else. Please do let me know if feasible, you could look at fixing the underlying issue. Or just recreate the problematic VM and not the entire Resource Group itself.
I would like to highlight the process of recovering the OS below:
Delete the VM encountering issues, keeping the virtual hard disks.
Attach and mount the virtual hard disk to another Windows VM for troubleshooting purposes.
Connect to the troubleshooting VM. Edit files or run any tools to fix issues on the original virtual hard disk.
Unmount and detach the virtual hard disk from the troubleshooting VM.
Create a VM using the original virtual hard disk.
Refer the document for more details on this process.

Start generalized azure VM

I am working on an azure deployment. I am using some templates from github that creates a certain number of VM's based on a 'master image', puts them behind a load balancer, and allows access to them through RDP and ports.
Now, all this is working great. I build my image, then I run sysprep and generalize it, shut it down, and spin up 40 copies.
The issue I am running into is what do I do if I want to update the 'master image'?
It won't let me boot it up, because it says it is generalized. And I am having a hard time setting up a new vm and attaching the OS disk "not sure if this is the right way"
Does anyone have any suggestions? I am coming from a VMware VDI environment, where I would just boot up the master, make changes, shut down, and snapshot and redeploy.
Also I am using the new Azure interface, which I believe is called AzureRM.
Error message: Operation Start VM is not allowed on VM xxx since the VM is generalized.
Like versioning, you have to create a new VM from the image made before, and then repeat the process again after your changes.
Well, its not pretty, but it should work:
Spin up a fresh copy. make your changes, then preform the sysprep / oobe process again, finally, generalize & capture.

Is it possible to Capture running machine on Azure or it is recommended to shutdown before?

I have an Ubuntu 14 VM on Azure to host my developed web sites. (I do not think the OS matters in the point of view the question, but never know)
I've discovered the relatively new Capture button, so for the storage price of a disk size I regularly save a "snapshot" via the Capture function (I am not preparing the image for provisioning, I mean not checking the "I have run 'waagent -deprovision' on the virtual machine" checkbox). Be aware quickly becomes pretty addictive.
The result is an image what I can use when creating new machines, its there in My Images in the wizard. This can function as a backup/rollback worflow. If I delete the VM and create a new from one of resulting image of the previously captured "snapshots". (again, no provisioning will take place)
It is possible to initiate the Capture operation on a running VM. It is not clear for me, if the result will be an image what is a template for a new VM, and that VM will start up and boot, in what state the filesystem etc will be?
Is not it a similar state than sudden power lost? If yes, then it is strongly recommended to always shutdown the VM before capturing, however this such a pain and productivity killer, so no one (including me) wants to do unless it is mandatory.
Accidentally I've switched to the new Azure portal and there the Capture UI says:
Capturing a virtual machine while it's running isn't recommended.

Azure Virtual Machine Capture

I have a Windows Server running as a Virtual Machine on Azure that I have installed SQL Enterprise on. I installed SQL Server onto a new drive (E:) so that the C: drive would remain for the OS.
I followed the instructions on how to use sysprep and basically capture the image to use going forward for new instances. After following these steps and deploying a new vm with this image, nothing worked. It thought SQL was installed (it wasn't). It also didn't know anything about the additional drives or VHDs.
I came across this Blog post from the Azure team and it references a powershell command Save-AzureVMImage that may be what I'm looking for with the new "Virtual Machine Image".
Ultimately what I want is to have an image that I can use to deploy a new fully functional Windows Server instance with SQL Enterprise installed and the additional VHDs being used... Can someone point me in the right hemisphere on this please...
Save-AzureVMImage until the build 2014 only captures OS disk and not the data disk, since your SQL is installed on a separate mapped drive a data disk. That will not be part of the snapshot\sysprep process.
There is something called VMImages recently launched which captures data disks along side OS disks.You will have to update Azure Commandlets to find more options while capturing Image of a running VM, Refer to the blogs below for more detailed solution
http://vishwanathsrikanth.wordpress.com/2014/04/16/windows-azure-vmimages-updates-to-clonevm-powershell-script/
http://blogs.msdn.com/b/windowsazure/archive/2014/04/14/vm-image-blog-post.aspx
Happy Coding !!

Resources