0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

EC2 instance snapshot and restore #ec2

Posted at

EC2 instance :camera: snapshot and :recycle: restore

:musical_score: 概要

EC2 の Instance のスナップショットを取得し, リストアします。

※既出情報ですが、この後に api を利用した自動化の記事を掲載する前段として記事化します

:scroll: snapshot 取得手順

:baby::id: Instance IDの取得

  • EC2管理コンソールの Instances を選択

ec2_snapshot_restore1.png

  • 対象 Instance の Instance ID をコピーしておく

:camera: Snapshot の作成

  • EC2管理コンソールの Volumes を選択
  • コピーしておいた Instance ID で検索

ec2_snapshot_restore2.png

  • 検索結果を右クリックしてメニューを表示
  • Create Snapshot を選択。ダイアログが表示されます

ec2_snapshot_restore3.png

  • Name と Description に任意の値を設定して Create を選択します

ec2_snapshot_restore4.png

  • Snapshot の作成が開始されます

ec2_snapshot_restore5.png

  • Snapshot の作成が開始されます

Snapshot の確認

  • EC2管理コンソールの Snapshots を選択
  • 先ほど作成した Snapshot が作成されていることを確認

ec2_snapshot_restore6.png

:recycle: restore

準備

restore する前に、スナップショットした時点と状態を変えるために tree をインストールします。

$ which tree
$ sudo apt-get install tree
# 略
$ which tree
/usr/bin/tree

Snapshot から Volume の作成

  • Snapshots から 対象の Snapshot を選択し、コンテキストメニューで Create Volume を選択します。

restore1.png

  • Create Volume の登録ダイアログの各項目を入力します
    • Availability Zone は Instance と同じにします

restore2.png

  • Create Volume の完了ダイアログが表示されます

restore3.png

Volume の確認

  • EC2管理コンソールの Volumes を選択
  • 先ほど作成した Volume が作成されていることを確認

restore4.png

:clock1::baby: Instance の停止

  • EC2管理コンソールの Instances を選択
  • リストア先の Instance を停止します

restore5.png

  • 停止するまでしばらく待ちます

restore6.png

  • 停止したことを確認します

restore7.png

Volume のデタッチ

  • EC2管理コンソールの Volumes を選択
  • 現在利用している Volume のコンテキストメニューから Detach Volume を選択

restore8.png

  • 確認ダイアログが表示されるので、 Yes, Detach を選択

restore9.png

  • 該当 Volume が in-use から available になったことを確認

Volume のアタッチ

  • Snapshot から作成した Volume のコンテキストメニューから attach Volume を選択

restore10.png

  • 入力ダイアログが表示されるので Instance ID を指定して Attach を選択
    • Device は、rootデバイスの /dev/sda を指定

restore11.png

  • 該当 Volume が available から in-use になったことを確認

:bangbang::runner: Instance を起動し、動作確認

  • EC2管理コンソールの Instances を選択
  • 起動対象の Instance を起動します
  • tree install 前の状態に戻っているか確認
$ which tree
# インストール前に戻ったことを確認
$

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?