VM Import/Export를 사용하여 디스크를 EBS 스냅샷으로 가져오기
VM Import/Export를 사용하면 디스크를 Amazon EBS 스냅샷으로 가져올 수 있습니다. 스냅샷이 생성되면 해당 스냅샷에서 EBS 볼륨을 생성한 다음 해당 볼륨을 EC2 인스턴스에 연결할 수 있습니다.
가져온 스냅샷에는 어떠한 용도로도 사용할 수 없는 임의의 볼륨 ID가 있습니다.
스냅샷을 가져오기 위한 사전 조건
-
VHD/VHDX(가상 하드 디스크), ESX VMDK(가상 머신 디스크), 원시 디스크 형식이 지원됩니다.
-
가장 먼저 Amazon S3로 디스크를 업로드해야 합니다.
-
가져오기 명령을 실행하는 데 사용할 컴퓨터에 AWS CLI를 아직 설치하지 않은 경우 AWS Command Line Interface 사용 설명서를 참조하세요.
스냅샷 가져오기 작업 시작
디스크 이미지를 포함하는 S3 버킷의 URL을 지정하거나 S3 버킷의 이름과 키를 입력할 수 있습니다.
- AWS CLI
-
스냅샷을 가져오는 방법
import-snapshot 명령을 사용합니다.
aws ec2 import-snapshot \
--description "My server VM" \
--disk-container "file://C:\import\containers.json"
containers.json 파일은 필수 정보가 포함된 JSON 문서입니다.
{
"Description": "My server VM",
"Format": "VMDK",
"UserBucket": {
"S3Bucket": "amzn-s3-demo-import-bucket",
"S3Key": "vms/my-server-vm.vmdk"
}
}
출력의 예시는 다음과 같습니다.
{
"Description": "My server VM",
"ImportTaskId": "import-snap-1234567890abcdef0",
"SnapshotTaskDetail": {
"Description": "My server VMDK",
"DiskImageSize": "0.0",
"Format": "VMDK",
"Progress": "3",
"Status": "active",
"StatusMessage": "pending",
"UserBucket": {
"S3Bucket": "amzn-s3-demo-import-bucket",
"S3Key": "vms/my-server-vm.vmdk"
}
}
}
- PowerShell
-
스냅샷을 가져오는 방법
Import-EC2Snapshot cmdlet을 사용합니다.
Import-EC2Snapshot `
-DiskContainer_Description "My server VM" `
-DiskContainer_Format "VMDK" `
-DiskContainer_S3Bucket "amzn-s3-demo-import-bucket" `
-DiskContainer_S3Key "vms/my-server-vm.vmdk"
출력의 예시는 다음과 같습니다.
Description ImportTaskId SnapshotTaskDetail Tags
----------- ------------ ------------------ ----
My server VM import-snap-1234567890abcdef0 Amazon.EC2.Model.SnapshotTaskDetail