Removing Product ID from AWS Marketplace product

To avoid paying addtional costs, and giving yourslelf the ablilty to use any type of Instance type you may require to remove the Product ID from a EC2 attached EDS volume. It is this product ID that is used by AWS  to enforce payment for the product.
Here is the procedure to remove the code from the volume.
## Launch a new instances
# In the AWS EC2 web console, create a new xxGB EBS volume. (same size as existing root vol. ) and in same AZ
# Whilst in the console attach the disk to the instance that will have its root copied get the name of the attached device /dev/sdf
# SSH into your instance, and format the secondary volume:
$ sudo su
$ Run lsblk  (to get the names of your disks)

Next run mkfs -t ext4 /dev/xvdf  (note the xvdf is retrieved using lsblk command)
Copy the root volume to the new volume: (Note: your root volume may appear as /dev/xvda instead of xvde)
$ dd bs=1M if=/dev/xvda of=/dev/xvdf
  • Once the raw copying has completed, stop the instance.(this could take sometime depending of the size of the volume {typically 30G will take 5 to 8 minutes)
  • Detach the original root volume from the instance. Detach the secondary volume, and re-attach it as /dev/sda1
  • In the EC2 web console, right-click on your instance and select “Create Image”. Once the image process is complete, you will now have a new base CentOS image with no AWS Marketplace code attached to it!
  • Create an AMI based on this image


Leave a comment

Your email address will not be published.