-2
我是初學者。'c4.2xlarge'類型的實例需要虛擬化類型'hvm'
嘗試使用com.amazonaws.services.ec2.model.RunInstancesRequest亞馬遜服務啓動EC2實例(c4.2xlarge)時。
我得到了以下錯誤。
2016-05-23 13:13:19 ERROR org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver: 213 - AmazonServiceException occurred when processing request: [POST] /leaseabuse-crawler-manager/instances/start
Virtualization type 'hvm' is required for instances of type 'c4.2xlarge'. Ensure that you are using an AMI with virtualization type 'hvm'. For more information, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/virtualization_types.html (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: 9c35befc-15ba-4010-b0c6-bf38285369f1). Stacktrace follows:
com.amazonaws.AmazonServiceException: Virtualization type 'hvm' is required for instances of type 'c4.2xlarge'. Ensure that you are using an AMI with virtualization type 'hvm'. For more information, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/virtualization_types.html (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: 9c35befc-15ba-4010-b0c6-bf38285369f1)
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1369)
at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:913)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:631)
at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:400)
at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:362)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:311)
at com.amazonaws.services.ec2.AmazonEC2Client.invoke(AmazonEC2Client.java:11093)
at com.amazonaws.services.ec2.AmazonEC2Client.runInstances(AmazonEC2Client.java:10618)
at com.leaseabuse.devops.AwsService.startInstances(AwsService.groovy:167)
at com.leaseabuse.devops.InstancesController.start(InstancesController.groovy:34)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-05-23 13:13:19 DEBUG grails.app.filters.com.leaseabuse.devops.ApiKeyFilters: 128 - Security enabled
下面是我想使用
RunInstancesRequest runInstancesRequest = new RunInstancesRequest()
.withInstanceType(InstanceType.C42xlarge)
.withImageId(amiId)
.withMinCount(count)
.withMaxCount(count)
.withSecurityGroupIds("some-group")
.withKeyName("Key-name")
任何人都可以建議我在哪裏,我錯了代碼。 請幫忙出來。
感謝您的回答@ceejayoz,但我現在應該做什麼。 是我必須創建一個hvm類型的AMI。 –
@SandeepRoniyaar創建一個新的HVM AMI,或堅持仍舊支持PV的舊實例類型。我建議使用HVM方法 - PV代將最終完全消失。 – ceejayoz