[英]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.