Skip to main content

EC2 instance의 이미지 생성

Stop EC2 Instance

We이제 will실행 now중인 stop인스턴스를 the중지하겠습니다. running계속 instance.진행하기 Before전에 we실행 proceed,중인 it애플리케이션을 is모두 a중지하고 good데이터가 idea저장되어 to있는지 stop확인하는 any것이 running좋습니다. applications인스턴스를 and중지하는 ensure것은 that컴퓨터/서버를 data끄는 is것과 saved. Stopping an instance is equivalent to turning off your computer/server.같습니다.

NOTE:이미지를 It만들기 is전에 best인스턴스를 practices,중지하는 but것이 not가장 mandatory,좋지만 to필수는 stop아닙니다. the그러나 instance이미지를 before만드는 creating동안 the인스턴스가 image.재부팅되므로 However실행 while중인 creating애플리케이션이 the없는지 image확인해야 the합니다.

instance will undergo a reboot, so make sure there are no applications running.

  1. Before인스턴스를 stopping, copy all the required data from중지하면 /tmptmp가 to지워지므로 a중지하기 more전에 persistent필요한 storage모든 as stopping the instance will clear out데이터를 /tmp.tmp에서 Copy보다 all영구적인 the스토리지로 required복사하세요. files계속 to진행하기 the전에 모든 필수 파일을 이전에 마운트한 EBS volume we mounted previously, at 볼륨(/mnt/volume1,)에 before proceeding.복사합니다.

Make복사하기 sure전에 to디렉터리에 set대한 the권한을 permissions설정해야 to the directory prior to copying.합니다.

sudo chmod -R 777 /mnt/volume1/
cp -ax /tmp/fastq /tmp/outbreaks /mnt/volume1/
  1. LoginAWS to콘솔에 the로그인하고, AWS Console,관리 and콘솔 in검색창에 the AWS Management Console search bar, type EC2를 입력합니다.

     

  2. Choose EC2 to open the선택하여 EC2 Dashboard를 엽니다.

     

  3. In왼쪽 the탐색 left Navigation pane, Click on창에서 Instances to view클릭하여 all실행 the중, instances중지 that중, are종료된 Running,모든 Stopped인스턴스를 and확인합니다.

    Terminated.

     

  4. Select인스턴스를 your instance.선택합니다.

NOTE:EC2 The인스턴스의 Instance State of the EC2 instance shows the machine is머신이 Running 중임을 보여줍니다.

  1. Click on the Actions button버튼을 and클릭한 then다음 click on Instance State, and클릭하고 finally click on마지막으로 Stop를 클릭합니다.

Screenshot 2023-09-27 at 4.34.50 PM.png

  1. On대화 the상자에서 dialogStop를 box클릭하여 click인스턴스 on중지를 Stop확인합니다. to confirm stopping the instance.

Screenshot 2023-09-27 at 4.35.51 PM.png

  1. Note이제 that인스턴스가 the중지를 instance시도하고 will잠시 now attempt to stop, and after a short duration the Instance StateState가 willStopped으로 change to Stopped변경됩니다. You창을 may새로 have고쳐야 to refresh수도 the있습니다. window.

 

Create EC2 Image

We will now create an image of the이제 EC2 instance.인스턴스의 이미지를 생성하겠습니다.

  1. Select the중지한 EC2 instance인스턴스를 we stopped, click on the선택하고, Actions button,버튼을 click클릭한 on다음, Image를 클릭하고, and click Create Image을 클릭합니다. 

Screenshot 2023-09-27 at 5.17.43 PM.png

  1. On이미지 the생성 Create페이지에서 Image이미지 page,이름과 provide이미지 an설명을 Image Name and Image description입력합니다. Ensure"x" you버튼을 remove클릭하여 theEC2 extra인스턴스에 연결한 추가 EBS volume볼륨을 we제거해야 had합니다(아래 attached이미지 to처럼 the1개만 EC2남으면 instance by clicking on the “x” button (see image below) 됩니다). Click이미지 on생성을 Create클릭하여 Image이미지 to생성 start작업을 the Image creation task.시작합니다.

Screenshot 2023-09-27 at 5.19.05 PM.png

이미지

An생성 image작업이 creation백그라운드에서 task시작되고 is준비가 started in the backgroud and you will see a message stating “Successfully created …” on the top of the완료되면 EC2 Dashboard대시보드 page페이지 when상단에 it’s"성공적으로 ready생성됨 to..."이라는 go.메시지가 표시됩니다.

NOTE:인스턴스를 In중지하지 case않고 you계속 had로그인한 not상태였다면 stopped인스턴스가 the instance and were still logged in, the instance would have rebooted and your재부팅되고 ssh session세션이 would종료되었을 have것입니다. ended.다시 You연결해야 will need to connect again 합니다(verify the IP address)주소 확인).

  1. Pause이미지 for생성 a작업이 minute진행되도록 to잠시 let멈춥니다. the이미지가 Image생성되었는지 creation확인하려면 task왼쪽 progress.탐색 To창의 check이미지 if the image has been created click on섹션에서 AMIs under클릭하면 the이전에 Images생성된 section모든 inAMI와 the진행 left중인 Navigation paneAMI를 to view all있습니다. the AMI’s created earlier as well as the new one in progress.

You willAMI가 see생성 that중이거나 the이미 new생성되어 AMI사용자가 is지정한 either이름으로 being사용할 created준비가 or already것을 created확인할 and ready for use with the name you’ve given.있습니다.

Screenshot 2023-09-27 at 6.03.26 PM.png

  1. Select your new AMI instance,인스턴스를 click on the선택하고 Actions button,버튼을 then클릭한 다음 Manage Tags 를 클릭합니다. Make이전과 sure마찬가지로 to이미지에 tag이름, your사용자 image with태그 a기능을 Name,사용해 User,리소스에 and태깅할 Grant tag, as before. For this instance, you can use the Name value “[your-initials]-AMI”있습니다.

Screenshot 2023-09-27 at 6.03.55 PM.png

Screenshot 2023-09-27 at 6.04.24 PM.png