简体   繁体   English

此实例类型当前不支持虚拟化类型为“hvm”的非Windows实例:[AWS Cloudformation]

[英]Non-Windows instances with a virtualization type of 'hvm' are currently not supported for this instance type : [AWS Cloudformation]

I am trying to create a an t2.micro ec2 instance with amazon linux as os using cloudformation . 我正在尝试用amazon linux创建一个t2.micro ec2实例作为os使用cloudformation。 Following is the json file (parts that matter). 以下是json文件(重要的部分)。

    "FileName" :{
        "Type" : "String",
        "Default" : "cf-file.sh",
        "AllowedValues": [ "cf-file.sh"]
    },
    "InstanceType" : {
      "Description" : "WebServer EC2 instance type",
      "Type" : "String",
      "Default" : "t2.micro",
      "AllowedValues" : ["t2.micro"],
      "ConstraintDescription" : "must be a valid EC2 instance type."
    },

       "AMIID" :{
         "Type": "String",
        "Default":"ami-1ecae776",
        "AllowedValues":["ami-1ecae776"]
    }
  },
  "Resources" : {
    "EC2Instance" : {
      "Type" : "AWS::EC2::Instance",
      "Properties" : {
        "UserData" : {
                "Fn::Base64" : {
                    "Fn::Join" : [ 
                            "", 
                            [
                                "#!/bin/bash\n",
                                "yes y | yum install dos2unix\n",
                                "touch ",{ "Ref" : "FileName" },"\n",
                                "chmod 777 ",{ "Ref" : "FileName" },"\n" 
                            ]
                    ]
                 } 
        },
          "KeyName" : { "Ref" : "KeyName" },
        "ImageId" : { "Ref" : "AMIID" }
      }
    },

When i run this file i get following error 当我运行此文件时,我得到以下错误

Non-Windows instances with a virtualization type of 'hvm' are currently not supported for this instance type

I guess this error comes when we use t1 family instance type but i am using t2.micro. 我猜这个错误来自于我们使用t1族实例类型,但我使用的是t2.micro。 Please explain the reason why is it so ? 请解释一下为什么会这样?

" InstanceType " attribute is missing in Properties section of Resources. “资源”的“属性”部分中缺少“ InstanceType ”属性。 Therefore, It might be taking default instance type(m1.small) that does not support ' HVM ' virtualization type. 因此,它可能采用不支持“ HVM ”虚拟化类型的默认实例类型(m1.small)。 I faced the similar issue, fixed it by adding Instance Type attribute. 我遇到了类似的问题,通过添加Instance Type属性修复了它。 Also,' t2.micro ' instance type does not support instance-store root device. 此外,' t2.micro '实例类型不支持实例存储根设备。 Please refer to sample snippet below for reference: 请参阅下面的示例代码段以供参考:


"Parameters":{
    "ServerKeyName":{
        "Description" :"key pair to connect to  Server",
        "Type": "AWS::EC2::KeyPair::KeyName"
    },
    "InstanceType" : {
        "Description" : "Type of EC2 instance to launch",
        "Type" : "String",
        "Default" : "t2.micro"
    },
    ....
    ....
}
....
....
"Properties" : {
    "KeyName" : { "Ref" : "ServerKeyName" },

    "Tags" : [
    {
        "Key" : "Name",
        "Value" : "test Server"
    }],

    "ImageId" : { "Ref" : "InstanceAMI" },
    "InstanceType" : { "Ref" : "InstanceType"},
    ....
    ....
    ....
}

In case anyone runs across this error while trying to build a Packer ami. 如果有人在尝试构建Packer ami时遇到此错误。 Make sure your template file is named with a packer extension and not json. 确保您的模板文件以包装器扩展名命名,而不是以json命名。

For instance, "packer build template.json" was failing with 例如,“packer build template.json”失败了

Error launching source instance: InvalidParameterCombination: Non-Windows instances with a virtualization type of 'hvm' are currently not supported for this instance type. 启动源实例时出错:InvalidParameterCombination:此实例类型当前不支持虚拟化类型为“hvm”的非Windows实例。 status code: 400, request id: 状态码:400,请求ID:

Whereas packer build template.packer works just fine. 虽然packer build template.packer工作得很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Cloudformation模板提供了“该实例类型当前不支持虚拟化类型为'hvm'的非Windows实例 - Cloudformation template gives " Non-Windows instances with a virtualization type of 'hvm' are currently not supported for this instance type 类型“ c4.2xlarge”的实例需要虚拟化类型“ hvm” - Virtualization type 'hvm' is required for instances of type 'c4.2xlarge' 't2.micro'类型的实例需要虚拟化类型'hvm' - Virtualization type 'hvm' is required for instances of type 't2.micro' AWS:AMI将实例类型更新为不受支持的实例类型 - AWS: Update instance type to a non-supported instance type by the AMI 更改实例的虚拟化类型 - change virtualization type for an instance AWS在vm虚拟化中将ebs卷与厨师结合在一起 - aws attach ebs volume with chef in hvm virtualization AWS HVM 实例成本 - AWS HVM instance cost Terraform:如何仅在支持请求的实例类型的区域中请求 AWS EC2 实例? - Terraform: How to request AWS EC2 instances only in zones where the requested instance type is supported? 如何知道哪种实例类型可用于HVM或PV? - How to know which instance type available for HVM or PV? 如何向 AWS CloudFormation 提供非字母数字参数类型 - How to supply non-alphanumeric parameter type to AWS CloudFormation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM