I want to create some training videos where I install software on a Windows machine. There might be several scenarios that I have to cover so I want to start with an "out of the box" install of Windows for each video. Is there a way to do this with AWS EC2 without having to destroy and create a new instance each time?
The perfect situation would be where I could export an image and then reload that image when I start the instance again. Is this possible?
Amazon EC2 uses Amazon Machine Images (AMIs) to create a bootable copy of a disk. An AMI can be created from an existing instance. When an AMI is used to launch a new instance, the disk will contain an exact copy of the original disk.
This does, however, involve launching a new instance.
If you want your disk to magically reset without creating a new instance, then you'll need to find a Windows utility that provides this capability (like Deep Freeze) since this takes place inside the computer and Operating System, which AWS cannot access.
Related
Thinking out loud:
If I can create a snapshot of a root disk and create a running VM from the snapshot, why do cloud providers also provide the option to create images from a running VM and use the same for creating other instances?
Well, Snapshots are point-in-time copies, and Images created from running VMs also do the same job.
Let us say I need a point in time of a running machine to be used over and again for deployments - Snapshots are the answer
Or, if I need a customized OS, specific to my environmental requirements, I create an image. Other than these purposes,
Question 1: Why do the two options exist?
Question 2: where should I use a snapshot for creating disk images?
Question 3: Where should I use an Image, rather than a snapshot?
Question 4: Why Cloned Disks?
As the title describes, I am trying to find a way of allowing multiple Windows Virtual Machines to share an installed app from a separate disk image. My challenges are here,
I cannot install all the apps on the primary disk image (Cs) of VMs for image size issues.
I do not want to install all the apps on startup because it's time-consuming.
Instead, I want to create a separate disk image (D) with all the Windows apps there, but I do not want to replicate this image for all the VMs. Thus, the Cs should have simultaneous access to the apps in the same disk image D.
I am not really optimistic about this possibility but I would like to try a shot here. If I missed any detail, please let me know.
I am trying to setup a static html page to be hosted on EBS volume that is mounted on Windows EC2 (I could do this in Linux but need to do on Windows now). I also need to configure IIS to make this as default location. i.e. can't host my pages on ephemeral storage (and hence this EBS). But I am struggling on how to (1) place my static files on this EBS and (2) configure IIS to have this as default location. I am assuming if i solve (1), then part (2) also gets solved.
I have launched a Windows EC2 instance, mounted a 1GB EBS volume and am able to RDP and see the 1GB volume in the Disk Management screen (shows up as Disk1, while C-drive shows up as Disk0). I need to host a simple static html page on the EBS volume (and not on temporary storage).
I am lost on how to place my html files on this Disk1 (and once i do this i can change the default website settings in IIS to look for this new drive/folder).
This link https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2-windows-volumes.html talks about getting volume ID's but i am not sure what I can do even i get the vol ID. (I am a novice and not sure how to configure IIS to look, by default, at folder on this volume ID)
Appreciate your help!
I just found out that I could right click on the sloped stripes area in the Disk Management window and it gives option to lable the volume. I had clicked earlier on the box just left to this one and it wasn't giving this option.
I know that there are two types of virtual machine images, Generalized and Specialized.
If the OS has been generalized/de-provisioned, the virtual machine must be shut down in order to capture it as a VM Image. Once the VM has been captured as a VM Image, the virtual machine will automatically be deleted.
If the OS is specialized, the virtual machine can be captured while it is running or shut down. The captured virtual machine remains untouched. If an application consistent or cross-disk capture is needed, we recommend the virtual machine is shut down prior to capturing the VM Image.
Here I am trying to capture the image without shutting down the VM (Specialised).
I have the below code to capture the image using PowerShell.
Save-AzureRmVMImage -ResourceGroupName $rgame -VMName $vmname -DestinationContainerName $container -VHDNamePrefix $vhdname
but the above code throws the error as below
Save-AzureRmVMImage : Capture operation cannot be completed because the VM is not generalized.
ErrorCode: OperationNotAllowed
ErrorMessage: Capture operation cannot be completed because the VM is not generalized.
StatusCode: 409
I found I can set VM to Generalized using Set-AzureRmVM
Set-AzureRmVM -ResourceGroupName 'CaptureVmImageRG' -Name 'CaptureVmImage' -Generalized
Is there anyway so that I can set VM to Specialized and capture the image. Can someone please provide a working Powershell command to create a Specialized capture of a running VM for backup 'point in time' purposes, or any other mechanism e.g. resource explorer.
Thanks in advance.
The commands Save-AzureRmVMimage and Set-AzureRmVM are used for captureing Generalized images. Before you run the two cmdlet, you should log on to VM and use Sysprep to prepare the hard disk.
On ARM mode, for Specialized image, I don’t think you need use cmdlet to capture the image. You could copy your VHD to another storage account. The copied VHD is a Specialized image. You could use the VHD to recreate a new VM which has your data.
Based on my knowledge, you had better copy the VHD when the VM is stopped. More information please refer to the article
I think using Azure recovery services vault is a better solution. Azure supports backup your VM automatically and no need to stop your VMs. It is easy for you to recovery your VMs. More information please refer to the article.
With classic azure, you can capture specialized VMs as use the resulting image as a quick backup. With ARM azure, the capture command expects the VM to be sysprep'ed/generalized and will actually make the original VM not boot normally anymore. We had a few scary moments when using 'capture' in ARM thinking it was like Classic.
Invoking a manual backup through Recovery Services is an option, but it takes too long! You may say that once the snapshot phase is complete and the process is in the transferring to vault phase, you can continue to use the original VM. But if the backup fails, which may not happen until many hours later, there is no snapshot or new backup to recover from.
So fastest and most reliable way to copy a VM is to just shutdown the VM and then make a copy of the vhds.
Is there a way to run an Amazon EC2 AMI image in Windows? I'd like to be able to do some testing and configuration locally. I'm looking for something like Virtual PC.
If you build your images from scratch you can do it with VMware (or insert your favorite VM software here).
Build and install your linux box as you'd like it, then run the AMI packaging/uploading tools in the guest. Then, just keep backup copies of your VM image in sync with the different AMI's you upload.
Some caveats: you'll need to make sure you're using compatible kernels, or at least have compatible kernel modules in the VM, or your instance won't boot on the EC2 network. You'll also have to make sure your system can autoconfigure itself, too (network, mounts, etc).
If you want to use an existing AMI, it's a little trickier. You need to download and unpack the AMI into a VM image, add a kernel and boot it. As far as I know, there's no 'one click' method to make it work. Also, the AMI's might be encrypted (I know they are at least signed).
You may be able to do this by having a 'bootstrap' VM set up to specifically extract the AMI's into a virtual disk using the AMI tools, then boot that virtual disk separately.
I know it's pretty vague, but those are the steps you'd have to go through. You could probably do some scripting to automate the process of converting AMI's to vdks.
The Amazon forum is also helpful. For example, see this article.
Oh, this article also talks about some of these processes in detail.
Amazon EC2 with Windows Server - announced this morning, very exciting
http://aws.amazon.com/windows/
It's a bit of a square peg in a round hole ... kind of like running MS-Office on Linux.
Depending on how you value your time, it's cheaper to just get another PC and install Linux and Xen.