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.
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전에 모든 필수 파일을 이전에 마운트한 EBSvolume 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/
-
LoginAWSto콘솔에the로그인하고, AWSConsole,관리and콘솔in검색창에the AWS Management Console search bar, typeEC2를 입력합니다. -
ChooseEC2를to open the선택하여 EC2 Dashboard를 엽니다. -
In왼쪽the탐색left Navigation pane, Click on창에서 Instancesto를view클릭하여all실행the중,instances중지that중,are종료된Running,모든Stopped인스턴스를and확인합니다.Terminated. -
Select인스턴스를your instance.선택합니다.
NOTE:EC2The인스턴스의 Instance State는of the EC2 instance shows the machine is머신이 Running 중임을 보여줍니다.
Click on theActionsbutton버튼을and클릭한then다음click onInstance State,를and클릭하고finally click on마지막으로 Stop를 클릭합니다.
On대화the상자에서dialogStop를box클릭하여click인스턴스on중지를Stop확인합니다.to confirm stopping the instance.
Note이제that인스턴스가the중지를instance시도하고will잠시now후attempt to stop, and after a short duration theInstanceStateState가willStopped으로change toStopped변경됩니다.You창을may새로have고쳐야to할refresh수도the있습니다.window.
Create EC2 Image
We will now create an image of the이제 EC2 instance.인스턴스의 이미지를 생성하겠습니다.
Select the중지한 EC2instance인스턴스를we stopped, click on the선택하고, Actionsbutton,버튼을click클릭한on다음, Image를 클릭하고,and clickCreate Image을 클릭합니다.
On이미지the생성Create페이지에서Image이미지page,이름과provide이미지an설명을Image NameandImage description입력합니다.Ensure"x"you버튼을remove클릭하여theEC2extra인스턴스에 연결한 추가 EBSvolume볼륨을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.시작합니다.
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재부팅되고 sshsession세션이would종료되었을have것입니다.ended.다시You연결해야will need to connect again합니다(verify theIPaddress)주소 확인).
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.있습니다.
Select your new새 AMIinstance,인스턴스를click on the선택하고 Actionsbutton,버튼을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”있습니다.