New lightsail instance from snapshot without sysprep

1

I have several times created a new lightsail Windows 2019 instance from a snapshot of a server which I have fully configured (IIS, web sites, users, firewall etc). The new instance runs perfectly. I did not use sysprep ever. Does anyone know what ill effects I might encounter a) if I create new instance without sysprep, but terminate the old instance (as described above) b) if I create a new instance without sysprep, and keep the other instance running. Ie two clones running, but on different ip addresses Thanks

Venton
asked 3 years ago733 views
5 Answers
1

Thanks for your answer. From my testing, the only 'ill effect' I've seen of creating a new instance from a non sysprep snapshot is that the machine name is identical to the first. This can be confusing, and changing the machine name seems to cause issues. The advantage is that literally everything else works with no more fussing. I think if simply replacing one instance with another (perhaps larger) I'd go this route.

I was having big problems getting sysprep to work, but I found this was because I had changed the name of the Administrator account on my source machine. When I changed it back to Administrator, Lightsail allowed me to access the new sysprepped image. Without an account named Administrator, Lightsail would never give me the password, or allow access to new instance.

The advantage of the sysprepped image over a straight clone was that a new machine name was generated. The disadvantage was that several things needed to be reset, including Scheduled tasks needed to be resaved Sqlserver needed some scripts to be run to allow Mixed logon. Recreate self signed certs for IIS. Reenter some authorisation details on IIS.

One thing I would say is be patient when firing up the new sysprepped image, it takes a good 15 mins for the password to be exposed and RDP to connect.

Venton
answered 3 years ago
  • There's a lot of info at https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Creating_EBSbacked_WinAMI.html about sysprep. Including this bit: "EC2Launch offers a default answer file and batch files for Sysprep that automate and secure the image-preparation process on your AMI. Modifying these files is optional." Perhaps, you can experiment with sysprep's config files and see if some of the "ill effects" can be resolved, including regenerating the machine name.

  • Procedural note: We're all new rePost system here :) It works differently from Forums we are all familiar with. Please post an answer when it is actually an answer to the question at the top of the page. Otherwise please use comment buttons.

0

Can you clarify what exactly you're worried about? I'm assuming something to do with licensing? If so, unfortunately I can't help with that, otherwise, go ahead and create/destroy as many instances you want to test as long as you have your original snapshot that you can revert back to if things go wrong. That's the beauty of the cloud :)

answered 3 years ago
0

No not licensing as I still pay for every instance. Two things I'm worried about. Firstly, the instructions for creating a new instance from a windows snapshot specifically mention needing to run sysprep. I can't see it written anywhere that for Windows I can simply create a snapshot and create an instance from it. Linux instructions do seem that straight forward, not windows. This worries me that I can't see it in black and white. Surely a snapshot should be a really strong and quick backup option in case of disaster.

Secondly, if I was to run two cloned instances (without sysprep) .. does this confuse things in terms of the lightsail infrastructure? Will lightsail throw a wobbly when it finds two 'identical' machines?

The first worry is my main concern... I really wanted a quick and easy backup option. Here's the link to creating windows snapshot which worries me. https://lightsail.aws.amazon.com/ls/docs/en_us/articles/prepare-windows-based-instance-and-create-snapshot Thanks

Venton
answered 3 years ago
0

Not really here to criticise the documentation, I'd just like to confirm if I really can just create a snapshot without sysprep, delete my instance, create new one from snapshot etc. (windows specifically).

The document https://lightsail.aws.amazon.com/ls/docs/en_us/articles/prepare-windows-based-instance-and-create-snapshot says:

If your instance doesn't function as expected after running Sysprep, then follow the steps in Creating an instance from a snapshot in Amazon Lightsail to create a new instance from the backup snapshot. There is a link to this page: https://lightsail.aws.amazon.com/ls/docs/en_us/articles/lightsail-how-to-create-instance-from-snapshot

That page says: You must have a snapshot of an instance before you can create another instance from a snapshot. For more information, see Creating a snapshot of your Linux or Unix instance in Amazon Lightsail or Creating a snapshot of your Windows Server instance in Amazon Lightsail. ... which points back to the first page....

It's cyclicle.... take a snapshot before you take a snapshot, if you have trouble after taking snapshot, create an instance...

Venton
answered 3 years ago
0

Here's a simplified/vague description of how sysprep works. Bear in mind, that I am not a Windows specialist.

Sysprep has two phases of interest:

  1. In "generalize" phase, sysprep executes during shutdown to prepare the instance to become a "prototype" from which you can clone some number of new instances. After the "generalize" phase finishes, various customizations, personalizations and so on, that you might have made, will be reset so that the disk of this instance is ready to be cloned to make new instances. Once shutdown is complete, it is safe to make instance shapshots. Any instances created off such snapshots will enter...
  2. "Specialize" sysprep phase. At first boot, a new instance will initialize itself as a new machine, you can now personalize it again and configure it as you see fit. It's not going to be the same as the "prototype" instance but various installed software packages will still be the same. Anything that wasn't reset during "generalize" phase, will be the same as it was on the "prototype" instance's disk.

Note 1: If you don't initiate sysprep during shutdown, neither "generalize" nor "specialize" phases are executed.

Note 2: If you initiated shutdown with sysprep, the original instance will undergo both sysprep phases: "generalize" (during shutdown) and "specialize" (during boot).

To answer your question about "ill effects of not using sysprep": you should be fine as long as you keep record of Adminstrator password that the original instance was using, because all other instances that were made from such sysprep-less snapshots will have the same password.

A more definitive explanation about sysprep can be found in "Sysprep phases" section here: https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Creating_EBSbacked_WinAMI.html

AWS
MODERATOR
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions