1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Creating Flexible CUD 💰

Last updated at Posted at 2023-02-22

こんにちは。Enabling team の山本です。

最近は、花粉の影響で外出したくない今日この頃です。
空気清浄機から離れることができません。

さて、今回は Flexible CUD(リソース ベースの確定利用割引)について書きます。

ご存じのとおり、確定利用割引の1つとして、Flexible CUD が公開されました。

TL;DR

  • 金額にコミットする。
  • 割引率は、約 10% ほど劣りますが、利用者としてはコミットしやすい契約だと思います。
  • Region や Machine Type など自由度を持たせたい場合に向いています。

準備

Flexible CUD を設定する前に検討しておくことがあります。
それは、「時間単位の金額」です。

Flexible CUD は、時間単位で契約するため、$◯ per hour を決めておく必要があります。
課金 Export のデータから大体どれくらいの金額が妥当なのか検討しました。

SELECT 
usage_start_time,sum(cost)
FROM `hoge.all_billing_data.gcp_billing_export` 
WHERE DATE(_PARTITIONTIME) = "2023-02-14" 
     AND service.description = "Compute Engine"
     and project.id in ('hoge-prod','hoge-stg','hoge-dev')
     AND ( 1 = 0
       OR sku.description LIKE 'C2D AMD Instance Core running in%'
       OR sku.description LIKE 'C2D AMD Instance Ram running in%'
       OR sku.description LIKE 'C2D AMD Sole Tenancy Instance Core running in%'
       OR sku.description LIKE 'C2D AMD Sole Tenancy Instance RAM running in%'
       OR sku.description LIKE 'C2D AMD Sole Tenancy Instance Ram running in%'
       OR sku.description LIKE 'Compute optimized Core running in%'
       OR sku.description LIKE 'Compute optimized Instance Core running in%'
       OR sku.description LIKE 'Compute optimized Instance Ram running in%'
       OR sku.description LIKE 'Compute optimized Ram running in%'
       OR sku.description LIKE 'Compute-optimized Sole Tenancy Instance Core running in%'
       OR sku.description LIKE 'Compute-optimized Sole Tenancy Instance RAM running in%'
       OR sku.description LIKE 'Compute-optimized Sole Tenancy Instance Ram running in%'
       OR sku.description LIKE 'Custom E2 Instance Core running in%'
       OR sku.description LIKE 'Custom E2 Instance Ram running in%'
       OR sku.description LIKE 'Custom Extended Instance Ram running in%'
       OR sku.description LIKE 'Custom Instance Core running in%'
       OR sku.description LIKE 'Custom Instance Ram running in%'
       OR sku.description LIKE 'E2 Instance Core running in%'
       OR sku.description LIKE 'E2 Instance Ram running in%'
       OR sku.description LIKE 'N1 Predefined Instance Core running in%'
       OR sku.description LIKE 'N1 Predefined Instance Ram running in%'
       OR sku.description LIKE 'N2 Custom Extended Instance Ram running in%'
       OR sku.description LIKE 'N2 Custom Instance Core running in%'
       OR sku.description LIKE 'N2 Custom Instance Ram running in%'
       OR sku.description LIKE 'N2 Instance Core running in%'
       OR sku.description LIKE 'N2 Instance Ram running in%'
       OR sku.description LIKE 'N2 Sole Tenancy Instance Core running in%'
       OR sku.description LIKE 'N2 Sole Tenancy Instance RAM running in%'
       OR sku.description LIKE 'N2 Sole Tenancy Instance Ram running in%'
       OR sku.description LIKE 'N2D AMD Custom Extended Instance Ram running in%'
       OR sku.description LIKE 'N2D AMD Custom Extended Ram running in%'
       OR sku.description LIKE 'N2D AMD Custom Instance Core running in%'
       OR sku.description LIKE 'N2D AMD Custom Instance Ram running in%'
       OR sku.description LIKE 'N2D AMD Instance Core running in%'
       OR sku.description LIKE 'N2D AMD Instance Ram running in%'
       OR sku.description LIKE 'N2D AMD Sole Tenancy Instance Core running in%'
       OR sku.description LIKE 'N2D AMD Sole Tenancy Instance RAM running in%'
       OR sku.description LIKE 'N2D AMD Sole Tenancy Instance Ram running in%'
       OR sku.description LIKE 'Sole Tenancy Instance Core running in%'
       OR sku.description LIKE 'Sole Tenancy Instance RAM running in%'
       OR sku.description LIKE 'Sole Tenancy Instance Ram running in%' )
  GROUP BY
     usage_start_time     
  order by
     usage_start_time     

購入

金額を決めたところで購入に移ります。
以下の項目を埋めます。

  • コミットメント名
  • 期間
  • 1時間あたりのオンデマンド コミットメント
    • 先ほどの Query で計算した金額
      スクリーンショット 2023-02-22 10.31.48.png

まとめ

Flexible CUD について検討しました。
当面は、Cloud で稼働させる Application が多いため、他のサービスについても検討を進めます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?