【问题标题】:EC2 Instance creation fails due to VPC Issues由于 VPC 问题,EC2 实例创建失败
【发布时间】:2016-09-14 22:43:41
【问题描述】:

所以我关注这个链接:Autoscale based on SQS queue size 为我的实例创建一个自动缩放组。我已经阅读了很多关于我遇到的这个问题的文章,并且很多人都遇到了同样的问题,但是当他们尝试使用“t1.micro”时就会出现这种问题。然而,我使用的是“c4.xlarge”实例类型,并且我已经为我的图像定义了一个 VPC。为什么我仍然收到此错误:

Launching a new EC2 instance. Status Reason: The specified instance
type can only be used in a VPC. A subnet ID or network interface ID is
required to carry out the request. Launching EC2 instance failed.

有人对此有解决方案吗?

【问题讨论】:

  • 请详细说明您在创建 c4.xlarge 实例时所遵循的步骤。

标签: amazon-web-services amazon-ec2 amazon-sqs autoscaling vpc


【解决方案1】:

您需要在脚本或初始化中包含 VPC 信息:

http://docs.aws.amazon.com/autoscaling/latest/userguide/asg-in-vpc.html

【讨论】:

    【解决方案2】:

    不确定您使用的是什么 sdk,但对于您选择的任何 sdk,您需要指定生成实例的 VPC 子网。

    使用 aws cli 创建 ASG 时,您可以使用 --vpc-zone-identifier 指定相同的内容

    请查看以下文档的链接: http://docs.aws.amazon.com/cli/latest/reference/autoscaling/create-auto-scaling-group.html

    【讨论】:

      【解决方案3】:

      确保您在 cli 命令中定义了子网 ID。 尽管服务不同,但 aws cli 通常遵循相同的语法,因此可以将其调整为任何资源。

      aws emr create-cluster \
      --name "Test cluster" \
      --release-label emr-4.2.0 \
      --applications Name=Hadoop Name=Hive Name=Pig \
      --use-default-roles \
      --ec2-attributes KeyName=myKey,SubnetId=subnet-77XXXX03 \
      --instance-type m4.large \
      --instance-count 3
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-08-08
        • 2016-07-26
        • 2016-03-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多