AMI of Running Instance versus AMI of Shut Down Instance

0

** If I snapshot (AMI) an instance that is shut down versus If I snapshot (AMI) an instance that is in Running state - What is the difference between the two AMIs? Should they be same or different? Different in what ways? Thanks**

AG
질문됨 일 년 전276회 조회
1개 답변
0
수락된 답변

In general, it's better to take a snapshot of a shutdown instance (rather than a running one) if possible.

The reason is that if the instance is running then there may be files which the operating system has open which are not completely written to disk when the snapshot happens. Consider a database engine that is writing into many tables and indexes - it's quite possible that at the exact moment the snapshot is taken of the disk that there is data still in memory. When that snapshot is restored, the database will be inconsistent and this could easily lead to data loss.

Is this always the case? No. But it would be difficult to predict when a server is not writing to disk. Some applications (databases, specifically but others too) have flags to "quiesce" operations - that is, pause things while a snapshot is taken which is much better than taking a snapshot of a "live" disk.

Edit (adding): If the instance is hibernated then it is effectively paused. But that doesn't mean that the data has been written to disk successfully. If the applications are tracking the operating system state and are able to receive (and appropriately process) signals from the operating system about the hibernation then they should write data to disk. But that's not a guarantee and it depends on what is running on the instance.

profile pictureAWS
전문가
답변함 일 년 전
profile picture
전문가
검토됨 일 년 전
  • Thanks a ton! Makes sense. How will the AMI of a Hibernate instance differ or be the same from a Shut down instance?

  • Thanks @Brettski-AWS for the insightful response. I was wondering: " How will the AMI of a Hibernate instance differ or be the same from a Shut down instance?"

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠