如何在亚马逊EC2上更改实例类型

16

目前我使用的是m3.xlarge实例类型,但我想将其更改为t1.micro。我已经停止了服务器,并试图通过右键单击实例名称来更改实例类型

但当我点击提交以更改服务器名称时,在控制台中出现错误:

POST https://console.aws.amazon.com/ec2/modify-instance-attribute 400 (Bad Request) 

当我将其转化为网络请求后,从服务器获得的响应是:

{"errors":[{"service":"AmazonEC2","action":"ModifyInstanceAttribute","endPoint":"https://ec2.us-east-1.amazonaws.com","statusCode":400,"message":"Non-Windows instances with a virtualization type of 'hvm' are currently not supported for this instance type.","errorCode":"InvalidParameterCombination","errorType":"Unknown","requestId":"28025a27-4c3c-452c-8f04-fc4adc8eb335","serviceResponse":{"Response":{"Errors":{"Error":{"Code":"InvalidParameterCombination","Message":"Non-Windows instances with a virtualization type of 'hvm' are currently not supported for this instance type."}},"RequestID":"28025a27-4c3c-452c-8f04-fc4adc8eb335"}}}],"error":"Non-Windows instances with a virtualization type of 'hvm' are currently not supported for this instance type."}

我该如何解决这个问题,或者说我怎样才能把实例从xlarge更改为micro

2个回答

34
无论出于什么原因,亚马逊基于HVM的AMI与t1.micro大小不兼容。
亚马逊有基于硬件虚拟机(HVM)和基于半虚拟化机器(PVM)的AMI。从错误信息中可以看到,AWS正在说你当前的实例是基于HVM的,并且t1.micro大小只支持基于PVM的实例。
解决方法是从实例创建新的AMI,然后以t1.micro大小从那个AMI启动新的实例。但要小心,这可能会创建一个基于HVM的AMI,这种情况下,您需要为当前实例快照卷,并从中创建新的AMI。
关于HVM的更多信息: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using_cluster_computing.html#concepts_cluster_compute_hvmAMI http://aws.amazon.com/ec2/faqs/#Does_use_of_Cluster_Compute_Instances_differ_from_other_Amazon_EC2_instance_types

6
有趣的是,新的t2系列于昨天推出,取代了t1和m1系列的部分产品,仅支持HVM。亚马逊声称,由于具备更好的驱动程序,HVM性能现在超过了PV性能。http://aws.amazon.com/blogs/aws/low-cost-burstable-ec2-instances/ - Martijn Heemels
2
“...为您的当前实例拍摄卷,并从中创建一个新的AMI”。有人成功做到了吗?我尝试过相反的方向:使用我的PVM快照创建一个新的基于HVM的AMI(想要从t1迁移到t2),但是从那个AMI创建的HVM实例无法启动。在这里记录了[https://serverfault.com/questions/615188/aws-t1-to-t2-migration-client-instanceinitiatedshutdown-on-new-t2-instance]。如果有人做过,请提供一些逐步说明! - poshest
我在使用 kitchen-ec2 gem 时遇到了这个错误,并发现将 driver: 配置设置中的 flavor_id: c3.large 使用可以解决它。本质上,这个答案总结了问题:尝试使用支持 HVM AMI 的不同 EC2 实例 flavor。 - TrinitronX

0

我通过匹配实例类型解决了这个问题。您需要确保AMI和EC2的实例类型相同。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接