Finally the help of IT is here

Blog of computer solutions.

As cancel import duties on Amazon AWS of

Written by Xaus Xavier Nadal on May 18th, 2014

Save pagePDF pageemail pagePrint page

As we discussed in the previous article we can migrate virtual environments to Amazon AWS a fairly simple, but there are times that the task of migration to AWS failure and different instantiated Amazon EC2 in our environment we can not eliminate. The error that appears when you remove an instance EC2 is similar to the following.

Error terminating instances

 

Operation TerminateInstances is denied for the instance (s): i-0321dc43 (. Instance is being used by VM Import task import-i-ffx1u0r0 No charges are Incurred by stopped instances.)

To cancel tasks import in Amazon AWS and not wait for the expiration time of the task (which are usually 7 days) we access the command line of our AWS client and run several commands that I will explain below to stop the migration tasks and to finish the EC2 instance normally.

The first is to know the region where we have done the work of import or export, I remind you that with the command ec2-describe-regions or short command ec2dre we can see the list below and ensure a little nomenclature of each region

REGION us-east-1 ec2.us-east-1.amazonaws.com
REGION eu-west-sa-REGION ec1.eu-west-2.amazonaws.com 1-1 ec2.sa-east-1.amazonaws.com REGION east-northeast-ap-northeast ec1.ap 2-1.amazonaws. com REGION west-us-us-REGION ec2.us-west-2.amazonaws.com 2-1 west ec2.us-west-1.amazonaws.com ap-southeast REGION-1 ec2.ap-southeast-1.amazonaws .com

In our case the region where we have test servers we use to make the migration from VMware virtual environment is Ireland and will look there if we find a slope of finish work to remove instances work EC2 blocked by import

Run the command ec2-describe-conversion-tasks or the short name ec2-dct

C: \ AWS \ CLI \ bin>-region ec2dct eu-west-1
TaskType ImportInstance TaskId import-i-fflbhk06 ExpirationTime 2014-05-24T18: 09: 03Z Status active StatusMessage Pending InstanceID i-5d33ce1d Diskimage DiskImageFormat VMDKs DiskImageSize 6436109312 VolumeSi ze 30 AvailabilityZone eu-west-1c ApproximateBytesConverte d 0 Status active StatusMessage Pending: Downloaded 650117120 TaskType ImportInstance TaskId import-i-fh5aml6s ExpirationTime 2014-05-24T19: 22: 39Z Status active StatusMessage Pending InstanceID i-2e21dc6e Diskimage DiskImageFormat VMDKs DiskImageSize 6436109312 VolumeSi ze 30 AvailabilityZone eu-west-1c ApproximateBytesConverte d 0 Status active StatusMessage Pending: Downloaded 0 TaskType IMPORTINSTANCE TaskId import-i-ffx1u0r0 ExpirationTime 2014-05-24T19: 24: 04Z Status active StatusMessage Pendin g InstanceID i-0321dc43 Diskimage DiskImageFormat VMDKs DiskImageSize 6436109312 VolumeSi ze 30 AvailabilityZone eu-west-1c ApproximateBytesConverte d 0 Status active StatusMessage Pending: Downloaded 0 TaskType ImportInstance TaskId import-i-fg2jd969 ExpirationTime 2014-05-24T19: 27: 35Z Status completed InstanceID I-5021dc10 DISKIMAGE DiskImageFormat VMDK DiskImageSize 6436109312 VolumeId vol-abba0bac VolumeSize 30 AvailabilityZone eu-west- 1c ApproximateBytesConverted 6436102752 Status completed

We can see that we have many tasks with active status and status message is Pending (This means that work is on-hook)

Now knowing which of these migration tasks we want to eliminate use the command ec2-cancel-conversion-task or the short name ec2cct TaskId and name together with the region.

The command is used as follows:

ec2cct -region <region> TaskID

 

Let's see the outcome.

 

C: \ AWS \ CLI \ bin>-region ec2cct eu-west-1 import-i-fflbhk06

CONVERSION-TASK import-i-fflbhk06

 

If we check the status of migration with ec2dct -region eu-west-1 we can see that the state instead of active and puts canceling canceled after a while.

We do the same procedure with all pending tasks and migration and can eliminate the EC2 quietly outstanding instances.

I hope you have been useful article.

Greetings and until next time.

Related Posts Plugin for WordPress, Blogger ...
Tags: , , , ,


Leave a Reply

XHTML: You can use in Original tags: <a href="" title=""> <abbr title = ""> <acronym title = ""> <b> <blockquote cite = ""> <cite> <code> <del datetime = ""> <em> <i> <q cite = ""> <s> <strike> <strong>