Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new attribute capacitystatus causes collisions. #29

Open
andrewmcgilvray opened this issue Nov 5, 2018 · 0 comments
Open

new attribute capacitystatus causes collisions. #29

andrewmcgilvray opened this issue Nov 5, 2018 · 0 comments

Comments

@andrewmcgilvray
Copy link

Since the release of : https://aws.amazon.com/about-aws/whats-new/2018/10/Amazon-EC2-now-offers-On-Demand-Capacity-Reservations/

For the ec2 products there is now a capacitystatus attribute that can be either UnusedCapacityReservation, AllocatedCapacityReservation or Used.

This is causing collisions and any products are being excluded from the pricing results. Here is an example of the three products that would collide on the hash "t2.medium|Linux|Shared|No License required|NA|US West (Oregon)"

{u'attributes': {u'capacitystatus': u'UnusedCapacityReservation',
                 u'clockSpeed': u'Up to 3.3 GHz',
                 u'currentGeneration': u'Yes',
                 u'ecu': u'Variable',
                 u'instanceFamily': u'General purpose',
                 u'instanceType': u't2.medium',
                 u'instancesku': u'2ES9C4RF3WGQZAQN',
                 u'licenseModel': u'No License required',
                 u'location': u'US West (Oregon)',
                 u'locationType': u'AWS Region',
                 u'memory': u'4 GiB',
                 u'networkPerformance': u'Low to Moderate',
                 u'normalizationSizeFactor': u'2',
                 u'operatingSystem': u'Linux',
                 u'operation': u'RunInstances',
                 u'physicalProcessor': u'Intel Xeon Family',
                 u'preInstalledSw': u'NA',
                 u'processorArchitecture': u'32-bit or 64-bit',
                 u'processorFeatures': u'Intel AVX; Intel Turbo',
                 u'servicecode': u'AmazonEC2',
                 u'servicename': u'Amazon Elastic Compute Cloud',
                 u'storage': u'EBS only',
                 u'tenancy': u'Shared',
                 u'usagetype': u'USW2-UnusedBox:t2.medium',
                 u'vcpu': u'2'},
 u'productFamily': u'Compute Instance',
 u'sku': u'EUSSFEHB68A6B6DM'}
{u'attributes': {u'capacitystatus': u'Used',
                 u'clockSpeed': u'Up to 3.3 GHz',
                 u'currentGeneration': u'Yes',
                 u'ecu': u'Variable',
                 u'instanceFamily': u'General purpose',
                 u'instanceType': u't2.medium',
                 u'licenseModel': u'No License required',
                 u'location': u'US West (Oregon)',
                 u'locationType': u'AWS Region',
                 u'memory': u'4 GiB',
                 u'networkPerformance': u'Low to Moderate',
                 u'normalizationSizeFactor': u'2',
                 u'operatingSystem': u'Linux',
                 u'operation': u'RunInstances',
                 u'physicalProcessor': u'Intel Xeon Family',
                 u'preInstalledSw': u'NA',
                 u'processorArchitecture': u'32-bit or 64-bit',
                 u'processorFeatures': u'Intel AVX; Intel Turbo',
                 u'servicecode': u'AmazonEC2',
                 u'servicename': u'Amazon Elastic Compute Cloud',
                 u'storage': u'EBS only',
                 u'tenancy': u'Shared',
                 u'usagetype': u'USW2-BoxUsage:t2.medium',
                 u'vcpu': u'2'},
 u'productFamily': u'Compute Instance',
 u'sku': u'2ES9C4RF3WGQZAQN'}
{u'attributes': {u'capacitystatus': u'AllocatedCapacityReservation',
                 u'clockSpeed': u'Up to 3.3 GHz',
                 u'currentGeneration': u'Yes',
                 u'ecu': u'Variable',
                 u'instanceFamily': u'General purpose',
                 u'instanceType': u't2.medium',
                 u'instancesku': u'2ES9C4RF3WGQZAQN',
                 u'licenseModel': u'No License required',
                 u'location': u'US West (Oregon)',
                 u'locationType': u'AWS Region',
                 u'memory': u'4 GiB',
                 u'networkPerformance': u'Low to Moderate',
                 u'normalizationSizeFactor': u'2',
                 u'operatingSystem': u'Linux',
                 u'operation': u'RunInstances',
                 u'physicalProcessor': u'Intel Xeon Family',
                 u'preInstalledSw': u'NA',
                 u'processorArchitecture': u'32-bit or 64-bit',
                 u'processorFeatures': u'Intel AVX; Intel Turbo',
                 u'servicecode': u'AmazonEC2',
                 u'servicename': u'Amazon Elastic Compute Cloud',
                 u'storage': u'EBS only',
                 u'tenancy': u'Shared',
                 u'usagetype': u'USW2-Reservation:t2.medium',
                 u'vcpu': u'2'},
 u'productFamily': u'Compute Instance',
 u'sku': u'J4QDBG6HHGV8ND4P'}

For the moment I am adding an additional filter to "def _generate_reverse_sku_mapping":

                if product['attributes']['capacitystatus'] != 'Used':
                    continue

to get around the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant