简体   繁体   English

是否通过API检索Amazon EC2实例的许可证类型(linux / windows / windows + sqlserver)?

[英]Retrieving license type (linux/windows/windows+sqlserver) for an Amazon EC2 instance via the API?

I need to calculate the hourly running costs for my Amazon EC2 instances. 我需要计算Amazon EC2实例的每小时运行成本。 This varies even between instances with same hardware configs (instance types) because I use different amazon images (AMIs): some plain windows server and some windows server with sql server (both of them have additional costs compared with plain linux instances) 即使在具有相同硬件配置(实例类型)的实例之间,这也会有所不同,因为我使用了不同的亚马逊映像(AMI):某些普通Windows服务器和某些带有sql服务器的Windows服务器(与普通Linux实例相比,它们都有额外的成本)

The EC2 Java API has a describeInstances() method which returns Instance objects with metadata such as instance id, instance type (m1.small/large...), state (running,stopped..) public ip, etc. EC2 Java API有一个describeInstances()方法,该方法返回带有元数据的Instance对象,例如实例ID,实例类型(m1.small / large ...),状态(运行,已停止..)public ip等。

This Instance object also has a .getLicense().getPool() which according to the Java API should return "The license pool from which this license was used (ex: 'windows')." 此Instance对象还具有.getLicense()。getPool(),根据Java API,该对象应返回“使用了该许可证的许可证池(例如:'windows')”。 I thought this is were it may also give 'windows+sqlserver' or something to that effect. 我以为这是它也可能会给“ windows + sqlserver”或类似的东西。

The getLicense() method does however return null.. 但是,getLicense()方法确实返回null。

I've navigated around the EC2 web console, not being able to find this information, but I'm hoping that it is possible - otherwise it would mean that you cannot identify the true hourly cost of an particular instance unless you know which AMI was used to create it in the first place (plain windows server or windows server with sql server). 我已在EC2 Web控制台上导航,无法找到此信息,但我希望有可能-否则,这意味着您无法确定特定实例的真实每小时成本,除非您知道哪个AMI首先用于创建它(普通的Windows服务器或带有SQL Server的Windows服务器)。

Anyone? 任何人?

Thanks :) 谢谢 :)

/Geir /盖尔

Have you considered monitoring your actual billing information via CloudWatch ? 您是否考虑过通过CloudWatch监控实际的账单信息? It's a relatively new feature... 这是一个相对较新的功能...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM