tomomano / learn-aws-by-coding

コードで学ぶAWS入門
395 stars 38 forks source link

AMIが取得できません。 #41

Closed osaguild closed 2 years ago

osaguild commented 2 years ago

6.2.1. DLAMI (Deep Learning Amazon Machine Image) でAMIを取得してると思うのですが、image idが存在しないようです。

ec2 describe-images --owners amazon --image-ids "ami-09c0c16fc46a29ed9"

An error occurred (InvalidAMIID.NotFound) when calling the DescribeImages operation: The image id '[ami-09c0c16fc46a29ed9]' does not exist
osaguild commented 2 years ago

regionを指定したら取得できました。

aws ec2 describe-images --image-ids "ami-09c0c16fc46a29ed9" --region ap-northeast-1
{
    "Images": [
        {
            "Architecture": "x86_64",
            "CreationDate": "2020-05-20T14:47:04.000Z",
            "ImageId": "ami-09c0c16fc46a29ed9",
            "ImageLocation": "amazon/Deep Learning AMI (Amazon Linux 2) Version 29.0",
            "ImageType": "machine",
            "Public": true,
            "OwnerId": "898082745236",
            "PlatformDetails": "Linux/UNIX",
            "UsageOperation": "RunInstances",
            "State": "available",
            "BlockDeviceMappings": [
                {
                    "DeviceName": "/dev/xvda",
                    "Ebs": {
                        "DeleteOnTermination": true,
                        "SnapshotId": "snap-0bd381ab76e5a6146",
                        "VolumeSize": 90,
                        "VolumeType": "gp2",
                        "Encrypted": false
                    }
                }
            ],
            "Description": "MXNet-1.6.0, Tensorflow-2.1.0 & 1.15.2, PyTorch-1.4.0 & 1.5.0, Neuron, & other frameworks, NVIDIA CUDA, cuDNN, NCCL, Intel MKL-DNN, Docker, NVIDIA-Docker & EFA support. For fully managed experience, check: https://aws.amazon.com/sagemaker",
            "EnaSupport": true,
            "Hypervisor": "xen",
            "ImageOwnerAlias": "amazon",
            "Name": "Deep Learning AMI (Amazon Linux 2) Version 29.0",
            "RootDeviceName": "/dev/xvda",
            "RootDeviceType": "ebs",
            "SriovNetSupport": "simple",
            "VirtualizationType": "hvm"
        }
    ]
}
osaguild commented 2 years ago

私のdefault regionがus-east-1になっていることが原因でした。失礼しました。 私のようにregionの指定が異なる人のためにcommandを以下に変更するとよりわかりやすいと思いました。 aws ec2 describe-images --image-ids "ami-09c0c16fc46a29ed9" --region ap-northeast-1

tomomano commented 2 years ago

@osaguild

的確なご指摘どうもありがとうございます. たしかに,describe-images は特定のリージョンの AMI しか表示できませんね. ご提案を取り入れ,以下のコミットで微修正を行っておきました. https://github.com/tomomano/learn-aws-by-coding/commit/dc6fae1b3a1e4fee810a67d5987c4ddee29433c4

また,ほかにもお気づきの点などありましたらよろしくお願いします!

osaguild commented 2 years ago

@tomomano ありがとうございます。commitおよびwebへの反映も確認できました。 こちらのissueは私の方でcloseさせて頂きます。 こちらのサイトを活用させていただいているので、また気づいたことがあればコメントしますね!