Skip to content

Add support for cloud instances using Boavitza API #396

@mahendrapaipuri

Description

@mahendrapaipuri

Currently CEEMS exporter works only for bare metal instances where power/energy counters are available from different sources like IPMI, Redfish, RAPL, HWMon, etc. We can extend the support for cloud instances using Boavitza API. Especially we are interested in Cloud Instance Impact API end point where the verbose response includes the TDP of the instance. An exmaple response is as follows:

{
  "impacts": {
    "gwp": {
      "unit": "kgCO2eq",
      "description": "Total climate change",
      "embedded": {
        "value": 0.003,
        "min": 0.001763,
        "max": 0.005331,
        "warnings": [
          "End of life is not included in the calculation"
        ]
      },
      "use": {
        "value": 0.0086,
        "min": 0.00774,
        "max": 0.01032
      }
    },
    "adp": {
      "unit": "kgSbeq",
      "description": "Use of minerals and fossil ressources",
      "embedded": {
        "value": 3.1e-7,
        "min": 2.255e-7,
        "max": 4.331e-7,
        "warnings": [
          "End of life is not included in the calculation"
        ]
      },
      "use": {
        "value": 4.3e-9,
        "min": 3.837e-9,
        "max": 5.116e-9
      }
    },
    "pe": {
      "unit": "MJ",
      "description": "Consumption of primary energy",
      "embedded": {
        "value": 0.039,
        "min": 0.02287,
        "max": 0.06806,
        "warnings": [
          "End of life is not included in the calculation"
        ]
      },
      "use": {
        "value": 0.99,
        "min": 0.8916,
        "max": 1.189
      }
    }
  },
  "verbose": {
    "vcpu": {
      "value": 16,
      "status": "ARCHETYPE"
    },
    "memory": {
      "value": 64,
      "status": "ARCHETYPE",
      "unit": "GB"
    },
    "avg_power": {
      "value": 87.53749666666667,
      "status": "COMPLETED",
      "unit": "W",
      "min": 78.9812,
      "max": 105.30826666666667
    },
    "time_workload": {
      "value": [
        {
          "time_percentage": 100,
          "load_percentage": 100
        }
      ],
      "status": "INPUT",
      "unit": "%"
    },
    "usage_location": {
      "value": "FRA",
      "status": "INPUT",
      "unit": "CodSP3 - NCS Country Codes - NATO"
    },
    "duration": {
      "value": 1,
      "unit": "hours"
    },
    "ASSEMBLY-1": {
      "impacts": {
        "gwp": {
          "unit": "kgCO2eq",
          "description": "Total climate change",
          "embedded": {
            "value": 0.00001059,
            "min": 0.00001059,
            "max": 0.00001059,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": "not implemented"
        },
        "adp": {
          "unit": "kgSbeq",
          "description": "Use of minerals and fossil ressources",
          "embedded": {
            "value": 2.236e-12,
            "min": 2.236e-12,
            "max": 2.236e-12,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": "not implemented"
        },
        "pe": {
          "unit": "MJ",
          "description": "Consumption of primary energy",
          "embedded": {
            "value": 0.0001088,
            "min": 0.0001088,
            "max": 0.0001088,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": "not implemented"
        }
      },
      "units": {
        "value": 1,
        "status": "ARCHETYPE",
        "min": 1,
        "max": 1
      },
      "duration": {
        "value": 1,
        "unit": "hours"
      }
    },
    "CPU-1": {
      "impacts": {
        "gwp": {
          "unit": "kgCO2eq",
          "description": "Total climate change",
          "embedded": {
            "value": 0.0001078,
            "min": 0.0001078,
            "max": 0.0001078,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": {
            "value": 0.004669,
            "min": 0.004669,
            "max": 0.004669
          }
        },
        "adp": {
          "unit": "kgSbeq",
          "description": "Use of minerals and fossil ressources",
          "embedded": {
            "value": 6.471e-8,
            "min": 6.471e-8,
            "max": 6.471e-8,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": {
            "value": 2.314e-9,
            "min": 2.314e-9,
            "max": 2.314e-9
          }
        },
        "pe": {
          "unit": "MJ",
          "description": "Consumption of primary energy",
          "embedded": {
            "value": 0.001554,
            "min": 0.001554,
            "max": 0.001554,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": {
            "value": 0.5378,
            "min": 0.5378,
            "max": 0.5378
          }
        }
      },
      "units": {
        "value": 2,
        "status": "ARCHETYPE",
        "min": 2,
        "max": 2
      },
      "core_units": {
        "value": 96,
        "status": "COMPLETED",
        "source": "Completed from name name based on None.",
        "min": 96,
        "max": 96
      },
      "die_size": {
        "value": 1261,
        "status": "COMPLETED",
        "unit": "mm2",
        "source": "None : Completed from name name based on None.",
        "min": 1261,
        "max": 1261
      },
      "family": {
        "value": "Genoa",
        "status": "COMPLETED",
        "source": "Completed from name name based on None.",
        "min": "Genoa",
        "max": "Genoa"
      },
      "name": {
        "value": "AMD EPYC 9R14",
        "status": "COMPLETED",
        "source": "fuzzy match",
        "min": "AMD EPYC 9R14",
        "max": "AMD EPYC 9R14"
      },
      "tdp": {
        "value": 280,
        "status": "COMPLETED",
        "unit": "W",
        "source": "Completed from name name based on None.",
        "min": 280,
        "max": 280
      },
      "threads": {
        "value": 96,
        "status": "COMPLETED",
        "source": "Completed from name name based on None.",
        "min": 96,
        "max": 96
      },
      "duration": {
        "value": 1,
        "unit": "hours"
      },
      "avg_power": {
        "value": 47.641666666666666,
        "status": "COMPLETED",
        "unit": "W",
        "min": 47.641666666666666,
        "max": 47.641666666666666
      },
      "time_workload": {
        "value": [
          {
            "time_percentage": 100,
            "load_percentage": 100
          }
        ],
        "status": "INPUT",
        "unit": "%"
      },
      "usage_location": {
        "value": "FRA",
        "status": "INPUT",
        "unit": "CodSP3 - NCS Country Codes - NATO"
      },
      "use_time_ratio": {
        "value": 1,
        "status": "ARCHETYPE",
        "unit": "/1",
        "min": 1,
        "max": 1
      },
      "hours_life_time": {
        "value": 52560,
        "status": "COMPLETED",
        "unit": "hours",
        "source": "from device",
        "min": 52560,
        "max": 52560
      },
      "workloads": {
        "value": [
          {
            "load_percentage": 0,
            "power_watt": 33.6
          },
          {
            "load_percentage": 10,
            "power_watt": 89.60000000000001
          },
          {
            "load_percentage": 50,
            "power_watt": 210
          },
          {
            "load_percentage": 100,
            "power_watt": 285.6
          }
        ],
        "status": "COMPLETED",
        "unit": "workload_rate:W"
      },
      "params": {
        "value": {
          "a": 142.37421526775833,
          "b": 0.06348495115885536,
          "c": 20.451103166747014,
          "d": -3.78073508709148
        },
        "status": "COMPLETED",
        "source": "From TDP"
      },
      "gwp_factor": {
        "value": 0.098,
        "status": "COMPLETED",
        "unit": "kg CO2eq/kWh",
        "source": "https://www.sciencedirect.com/science/article/pii/S0306261921012149",
        "min": 0.098,
        "max": 0.098
      },
      "adp_factor": {
        "value": 4.85798e-8,
        "status": "COMPLETED",
        "unit": "kg Sbeq/kWh",
        "source": "ADEME Base IMPACTS ®",
        "min": 4.85798e-8,
        "max": 4.85798e-8
      },
      "pe_factor": {
        "value": 11.289,
        "status": "COMPLETED",
        "unit": "MJ/kWh",
        "source": "ADPf / (1-%renewable_energy)",
        "min": 11.289,
        "max": 11.289
      }
    },
    "RAM-1": {
      "impacts": {
        "gwp": {
          "unit": "kgCO2eq",
          "description": "Total climate change",
          "embedded": {
            "value": 0.0024,
            "min": 0.001327,
            "max": 0.004485,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": {
            "value": 0.001781,
            "min": 0.001781,
            "max": 0.001781
          }
        },
        "adp": {
          "unit": "kgSbeq",
          "description": "Use of minerals and fossil ressources",
          "embedded": {
            "value": 1.26e-7,
            "min": 9.661e-8,
            "max": 1.87e-7,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": {
            "value": 8.83e-10,
            "min": 8.83e-10,
            "max": 8.83e-10
          }
        },
        "pe": {
          "unit": "MJ",
          "description": "Consumption of primary energy",
          "embedded": {
            "value": 0.03,
            "min": 0.01681,
            "max": 0.056,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": {
            "value": 0.2052,
            "min": 0.2052,
            "max": 0.2052
          }
        }
      },
      "units": {
        "value": 24,
        "status": "ARCHETYPE",
        "min": 24,
        "max": 24
      },
      "capacity": {
        "value": 32,
        "status": "ARCHETYPE",
        "unit": "GB",
        "min": 32,
        "max": 32
      },
      "density": {
        "value": 1.2443636363636363,
        "status": "COMPLETED",
        "unit": "GB/cm2",
        "source": "Average of 11 rows",
        "min": 0.625,
        "max": 2.375
      },
      "duration": {
        "value": 1,
        "unit": "hours"
      },
      "avg_power": {
        "value": 18.175999999999995,
        "status": "COMPLETED",
        "unit": "W",
        "min": 18.175999999999995,
        "max": 18.175999999999995
      },
      "time_workload": {
        "value": [
          {
            "time_percentage": 100,
            "load_percentage": 100
          }
        ],
        "status": "INPUT",
        "unit": "%"
      },
      "usage_location": {
        "value": "FRA",
        "status": "INPUT",
        "unit": "CodSP3 - NCS Country Codes - NATO"
      },
      "use_time_ratio": {
        "value": 1,
        "status": "ARCHETYPE",
        "unit": "/1",
        "min": 1,
        "max": 1
      },
      "hours_life_time": {
        "value": 52560,
        "status": "COMPLETED",
        "unit": "hours",
        "source": "from device",
        "min": 52560,
        "max": 52560
      },
      "params": {
        "value": {
          "a": 9.088
        },
        "status": "COMPLETED",
        "source": "(ram_electrical_factor_per_go : 0.284) * (ram_capacity: 32.0) "
      },
      "gwp_factor": {
        "value": 0.098,
        "status": "COMPLETED",
        "unit": "kg CO2eq/kWh",
        "source": "https://www.sciencedirect.com/science/article/pii/S0306261921012149",
        "min": 0.098,
        "max": 0.098
      },
      "adp_factor": {
        "value": 4.85798e-8,
        "status": "COMPLETED",
        "unit": "kg Sbeq/kWh",
        "source": "ADEME Base IMPACTS ®",
        "min": 4.85798e-8,
        "max": 4.85798e-8
      },
      "pe_factor": {
        "value": 11.289,
        "status": "COMPLETED",
        "unit": "MJ/kWh",
        "source": "ADPf / (1-%renewable_energy)",
        "min": 11.289,
        "max": 11.289
      }
    },
    "POWER_SUPPLY-1": {
      "impacts": {
        "gwp": {
          "unit": "kgCO2eq",
          "description": "Total climate change",
          "embedded": {
            "value": 0.00023,
            "min": 0.00007705,
            "max": 0.0003853,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": "not implemented"
        },
        "adp": {
          "unit": "kgSbeq",
          "description": "Use of minerals and fossil ressources",
          "embedded": {
            "value": 8e-8,
            "min": 2.632e-8,
            "max": 1.316e-7,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": "not implemented"
        },
        "pe": {
          "unit": "MJ",
          "description": "Consumption of primary energy",
          "embedded": {
            "value": 0.0033,
            "min": 0.001116,
            "max": 0.005581,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": "not implemented"
        }
      },
      "units": {
        "value": 2,
        "status": "ARCHETYPE",
        "min": 2,
        "max": 2
      },
      "unit_weight": {
        "value": 2.99,
        "status": "ARCHETYPE",
        "unit": "kg",
        "min": 1,
        "max": 5
      },
      "duration": {
        "value": 1,
        "unit": "hours"
      }
    },
    "CASE-1": {
      "impacts": {
        "gwp": {
          "unit": "kgCO2eq",
          "description": "Total climate change",
          "embedded": {
            "value": 0.00024,
            "min": 0.0001362,
            "max": 0.0002378,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": "not implemented"
        },
        "adp": {
          "unit": "kgSbeq",
          "description": "Use of minerals and fossil ressources",
          "embedded": {
            "value": 3.2e-8,
            "min": 3.203e-8,
            "max": 4.387e-8,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": "not implemented"
        },
        "pe": {
          "unit": "MJ",
          "description": "Consumption of primary energy",
          "embedded": {
            "value": 0.0035,
            "min": 0.001948,
            "max": 0.003488,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": "not implemented"
        }
      },
      "units": {
        "value": 1,
        "status": "ARCHETYPE",
        "min": 1,
        "max": 1
      },
      "case_type": {
        "value": "rack",
        "status": "ARCHETYPE"
      },
      "duration": {
        "value": 1,
        "unit": "hours"
      }
    },
    "MOTHERBOARD-1": {
      "impacts": {
        "gwp": {
          "unit": "kgCO2eq",
          "description": "Total climate change",
          "embedded": {
            "value": 0.0001048,
            "min": 0.0001048,
            "max": 0.0001048,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": "not implemented"
        },
        "adp": {
          "unit": "kgSbeq",
          "description": "Use of minerals and fossil ressources",
          "embedded": {
            "value": 5.85e-9,
            "min": 5.85e-9,
            "max": 5.85e-9,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": "not implemented"
        },
        "pe": {
          "unit": "MJ",
          "description": "Consumption of primary energy",
          "embedded": {
            "value": 0.001325,
            "min": 0.001325,
            "max": 0.001325,
            "warnings": [
              "End of life is not included in the calculation"
            ]
          },
          "use": "not implemented"
        }
      },
      "units": {
        "value": 1,
        "status": "ARCHETYPE",
        "min": 1,
        "max": 1
      },
      "duration": {
        "value": 1,
        "unit": "hours"
      }
    },
    "use_time_ratio": {
      "value": 1,
      "status": "ARCHETYPE",
      "unit": "/1",
      "min": 1,
      "max": 1
    },
    "hours_life_time": {
      "value": 52560,
      "status": "COMPLETED",
      "unit": "hours",
      "source": "from device",
      "min": 52560,
      "max": 52560
    },
    "other_consumption_ratio": {
      "value": 0.33,
      "status": "ARCHETYPE",
      "unit": "ratio /1",
      "min": 0.2,
      "max": 0.6
    },
    "gwp_factor": {
      "value": 0.098,
      "status": "COMPLETED",
      "unit": "kg CO2eq/kWh",
      "source": "https://www.sciencedirect.com/science/article/pii/S0306261921012149",
      "min": 0.098,
      "max": 0.098
    },
    "adp_factor": {
      "value": 4.85798e-8,
      "status": "COMPLETED",
      "unit": "kg Sbeq/kWh",
      "source": "ADEME Base IMPACTS ®",
      "min": 4.85798e-8,
      "max": 4.85798e-8
    },
    "pe_factor": {
      "value": 11.289,
      "status": "COMPLETED",
      "unit": "MJ/kWh",
      "source": "ADPf / (1-%renewable_energy)",
      "min": 11.289,
      "max": 11.289
    }
  }
}

We can consider verbose['cpu-1']['avg_power'] and verbose['ram-1']['avg_power'] as max power usage of CPU and RAM of the instance and integrate it in ceems_tool to generate recording rules to estimate power usage based on these max values, instance CPU and RAM usage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions