Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to recover Windows system from EBS Snapshot by AWS

2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Background:

There is a problem with a Windows instance of EC2. Douzi intends to create an AMI image from the backed-up EBS Snapshot, and then create a new instance through the image. Then the problem arises: it's okay to perform the same operation on Linux several times, but it doesn't work on Windows. The problem lies in the image of AMI. The Windows image created by EBS Snapshot shows that the Platform he displays is other Linux. If I am using him to launch an instance, I cannot access it at all.

Solution: create an AMI through the AWS command line

Https://docs.aws.amazon.com/cli/latest/reference/ec2/import-image.html

Execute the following command, and he will create an AMI through the specified snapshotid, which is a slow process. It takes about 30 minutes to create a 100g hard disk of Douzi.

Aws ec2 import-image-license-type AWS-disk-containers SnapshotId=snap-XXXXXXXXX

While waiting, you can check the progress with the following command

Aws ec2 describe-import-image-tasks-import-task-ids import-ami-XXXXXXX

After the creation, it is found that the correct display of Platform is windows.

This allows you to create the EC2 instance again through this AMI.

Change login password

There may be another problem after the creation is successful. If the newly created server has a long history and the machine password expires, it will lose its trusted connection to AD, which means we need to log in with a local administrator account. This kind of instance restored through snapshot cannot change the administrator password directly through the control panel of EC2. We can reset it in the following ways

Window 2012

Https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ResettingAdminPassword_EC2Config.html

Windows 2016

Https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ResettingAdminPassword_EC2Launch.html

To put it simply, there are three steps:

Power off, the volume of the detach operating system will transfer this volume attach to another instance, then modify the file\ Program Files\ Amazon\ Ec2ConfigService\ Settings\ config.xml, and change disabled to Enabled.

Finally, re-attch the volume to the original instance, and pay attention to mounting the name / dev/sda1

Just reset the password to log in.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report