Cloudformation模板提供“虚拟化类型为“ hvm”的非Windows实例当前不支持此实例类型 [英] Cloudformation template gives " Non-Windows instances with a virtualization type of 'hvm' are currently not supported for this instance type

查看:162
本文介绍了Cloudformation模板提供“虚拟化类型为“ hvm”的非Windows实例当前不支持此实例类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个简单的cloudformation模板,该模板应在AWS上创建EC2实例。

I wrote a simple cloudformation template that should create an EC2 isntance on AWS.

Cloudformation模板提供了虚拟化类型为'hvm'的非Windows实例是目前不支持此实例类型。我在这个论坛上查询,他们说 InstanceType丢失了。我是Cloud形成的新手。我应该在哪里放置 InstanceTyp?非常感谢
{
AWSTemplateFormatVersion: 2010-09-09,

Cloudformation template gives " Non-Windows instances with a virtualization type of 'hvm' are currently not supported for this instance type." I looked up on this forum and they said "InstanceType" is missing. I am brand new to Cloud formation . Where should I put "InstanceTyp"? thanks much { "AWSTemplateFormatVersion" : "2010-09-09",

       "Description" : "AWS CloudFormation Sample Template EC2InstanceSample: Create an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based on the region in which the stack is run. This example uses the default security group, so to SSH to the new instance using the KeyPair you enter, you will need to have port 22 open in your default security group. **WARNING** This template an Amazon EC2 instances. You will be billed for the AWS resources used if you create a stack from this template.",

   "Parameters" : {
       "KeyName": {
        "Description" : "Name of an existing EC2 KeyPair ",
         "Type": "String",
         "MinLength": "1",
         "MaxLength": "255",
         "AllowedPattern" : "[\\x20-\\x7E]*",
         "ConstraintDescription" : "can contain only ASCII characters."
      }
    },

     "Mappings" : {
     "RegionMap" : {
            "us-east-1"      : { "AMI" : "ami-6df1e514" },
            "us-west-1"      : { "AMI" : "ami-6df1e514" },
            "us-west-2"      : { "AMI" : "ami-6df1e514" },
             "eu-west-1"      : { "AMI" : "ami-6df1e514" },
            "sa-east-1"      : { "AMI" : "ami-3e3be423" },
            "ap-southeast-1" : { "AMI" : "ami-74dda626" },
             "ap-southeast-2" : { "AMI" : "ami-b3990e89" },
             "ap-northeast-1" : { "AMI" : "ami-dcfa4edd" }
            }
           },

      "Resources" : {
         "Ec2Instance" : {
            "Type" : "AWS::EC2::Instance",
            "Properties" : {
            "KeyName" : { "Ref" : "KeyName" },
            "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" :    "AWS::Region" }, "AMI" ]},
           "UserData" : { "Fn::Base64" : "80" }
       }
      }
    },

     "Outputs" : {
"InstanceId" : {
  "Description" : "InstanceId of the newly created EC2 instance",
  "Value" : { "Ref" : "Ec2Instance" }
},
"AZ" : {
  "Description" : "Availability Zone of the newly created EC2 instance",
  "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "AvailabilityZone" ] }
},
"PublicIP" : {
  "Description" : "Public IP address of the newly created EC2 instance",
  "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "PublicIp" ] }
},
"PrivateIP" : {
  "Description" : "Private IP address of the newly created EC2 instance",
  "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "PrivateIp" ] }
},
"PublicDNS" : {
  "Description" : "Public DNSName of the newly created EC2 instance",
  "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "PublicDnsName" ] }
},
"PrivateDNS" : {
  "Description" : "Private DNSName of the newly created EC2 instance",
  "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "PrivateDnsName" ] }
  }
  }
 }


推荐答案

我看到您没有在CF中指定实例类型。默认类型为 m3.medium 。看起来在您正在使用 m3.medium 的区域中, hvm 类型的AMI不支持。

I see you are not specifying the instance type in CF. The default type is m3.medium. Looks like in the region you are using m3.medium is not supported for hvm type AMI.

一种指定实例类型的方法: EC2实例类型参数

One way to specify the instance type: EC2 Instance Type Parameter

这篇关于Cloudformation模板提供“虚拟化类型为“ hvm”的非Windows实例当前不支持此实例类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆