Zend_Service_Amazon_Ec2-ReservedInstance.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.service.amazon.ec2.reserved.instance">
  4. <title>Zend_Service_Amazon_Ec2: Reserved Instances</title>
  5. <para>
  6. With Amazon EC2 Reserved Instances, you can make a low one-time payment for
  7. each instance to reserve and receive a significant discount on the hourly
  8. usage charge for that instance.
  9. </para>
  10. <para>
  11. Amazon EC2 Reserved Instances are based on instance type and location
  12. (region and Availability Zone) for a specified period of time (e.g.,
  13. 1 year or 3 years) and are only available for Linux/UNIX instances.
  14. </para>
  15. <sect2 id="zend.service.amazon.ec2.reserved.instance.howitworks">
  16. <title>How Reserved Instances are Applied</title>
  17. <para>
  18. Reserved Instances are applied to instances that meet the type/location
  19. criteria during the specified period. In this example, a user is running
  20. the following instances:
  21. </para>
  22. <itemizedlist>
  23. <listitem>
  24. (4) m1.small instances in Availability Zone us-east-1a
  25. </listitem>
  26. <listitem>
  27. (4) c1.medium instances in Availability Zone us-east-1b
  28. </listitem>
  29. <listitem>
  30. (2) c1.xlarge instances in Availability Zone us-east-1b
  31. </listitem>
  32. </itemizedlist>
  33. <para>
  34. The user then purchases the following Reserved Instances.
  35. </para>
  36. <itemizedlist>
  37. <listitem>
  38. (2) m1.small instances in Availability Zone us-east-1a
  39. </listitem>
  40. <listitem>
  41. (2) c1.medium instances in Availability Zone us-east-1a
  42. </listitem>
  43. <listitem>
  44. (2) m1.xlarge instances in Availability Zone us-east-1a
  45. </listitem>
  46. </itemizedlist>
  47. <para>
  48. Amazon EC2 applies the two m1.small Reserved Instances to two of the instances
  49. in Availability Zone us-east-1a. Amazon EC2 doesn't apply the two c1.medium
  50. Reserved Instances because the c1.medium instances are in a different Availability
  51. Zone and does not apply the m1.xlarge Reserved Instances because there are no
  52. running m1.xlarge instances.
  53. </para>
  54. </sect2>
  55. <sect2 id="zend.service.amazon.ec2.reserved.instance.operations">
  56. <title>Reserved Instances Usage</title>
  57. <example id="zend.service.amazon.ec2.reserved.instance.operations.describe">
  58. <title>Describes Reserved Instances that you purchased.</title>
  59. <para>
  60. <code>describeInstances</code> will return information about a reserved
  61. instance or instances that you purchased.
  62. </para>
  63. <para>
  64. <code>describeInstances</code> returns a multi-demential array that contains
  65. reservedInstancesId, instanceType, availabilityZone, duration, fixedPrice,
  66. usagePrice, productDescription, instanceCount and state.
  67. </para>
  68. <programlisting language="php"><![CDATA[
  69. $ec2_instance = new Zend_Service_Amazon_Ec2_Instance_Reserved('aws_key',
  70. 'aws_secret_key');
  71. $return = $ec2_instance->describeInstances('instanceId');
  72. ]]></programlisting>
  73. </example>
  74. <example id="zend.service.amazon.ec2.reserved.instance.offerings.describe">
  75. <title>Describe current Reserved Instance Offerings aviable</title>
  76. <para>
  77. <code>describeOfferings</code> Describes Reserved Instance offerings
  78. that are available for purchase. With Amazon EC2 Reserved Instances,
  79. you purchase the right to launch Amazon EC2 instances for a period of
  80. time (without getting insufficient capacity errors) and pay a lower
  81. usage rate for the actual time used.
  82. </para>
  83. <para>
  84. <code>describeOfferings</code> returns a multi-demential array that contains
  85. reservedInstancesId, instanceType, availabilityZone, duration, fixedPrice,
  86. usagePrice and productDescription.
  87. </para>
  88. <programlisting language="php"><![CDATA[
  89. $ec2_instance = new Zend_Service_Amazon_Ec2_Instance_Reserved('aws_key',
  90. 'aws_secret_key');
  91. $return = $ec2_instance->describeOfferings();
  92. ]]></programlisting>
  93. </example>
  94. <example id="zend.service.amazon.ec2.reserved.instance.offerings.purchase">
  95. <title>Turn off CloudWatch Monitoring on an Instance(s)</title>
  96. <para>
  97. <code>purchaseOffering</code> Purchases a Reserved Instance for use with your
  98. account. With Amazon EC2 Reserved Instances, you purchase the right to launch
  99. Amazon EC2 instances for a period of time (without getting insufficient capacity
  100. errors) and pay a lower usage rate for the actual time used.
  101. </para>
  102. <para>
  103. <code>purchaseOffering</code> returns the reservedInstanceId.
  104. </para>
  105. <programlisting language="php"><![CDATA[
  106. $ec2_instance = new Zend_Service_Amazon_Ec2_Instance_Reserved('aws_key',
  107. 'aws_secret_key');
  108. $return = $ec2_instance->purchaseOffering('offeringId', 'instanceCount');
  109. ]]></programlisting>
  110. </example>
  111. </sect2>
  112. </sect1>