将成本管理数据转换为 FOCUS
本文档提供有关如何将成本管理实际数据集和摊销数据集转换为 FinOps 开放成本与使用规范 (FOCUS) 的指导。 若要详细了解 FOCUS,请参阅 FOCUS 概述。
如何将成本管理数据转换为 FOCUS
若要将成本和使用情况数据转换为 FOCUS,需要实际成本数据集和摊销成本数据集:
- 保留摊销成本数据中的所有行。
- 筛选实际成本数据,仅包含满足 ChargeType == "Purchase" 或 "Refund" 且 PricingModel == "Reservation" 或 "SavingsPlan" 的行。
将以下逻辑应用于所有行:
FOCUS 列 | 成本管理列 | 转换 |
---|---|---|
BilledCost | CostInBillingCurrency | 如果 ChargeType == "Usage" 且 PricingModel == "Reservation" 或 "SavingsPlan",则 0 ;否则,使用 CostInBillingCurrency |
BillingAccountId | • 企业协议:BillingAccountId • Microsoft 客户协议:BillingProfileId |
无 |
BillingAccountName | • 企业协议:BillingAccountName • Microsoft 客户协议:BillingProfileName |
无 |
BillingCurrency | • 企业协议:BillingCurrencyCode • Microsoft客户协议:BillingCurrency |
无 |
BillingPeriodEnd | BillingPeriodEndDate | 为独占结束日期添加一天 |
BillingPeriodStart | BillingPeriodStartDate | 无 |
ChargeCategory | ChargeType | 如果是 Usage 、Purchase 、Credit 或 Tax ,则为相同值;如果是 UnusedReservation 或 UnusedSavingsPlan ,则为 Usage ;如果是 Refund ,则为 Purchase ;其余情况为 Adjustment |
ChargeClass | ChargeType | 如果是 Refund ,则使用 Correction |
ChargeDescription | ProductName | 无 |
ChargeFrequency | 频率 | 如果是 OneTime ,则为 One-Time ;如果是 Recurring ,则为 Recurring ;如果是 UsageBased ,则为 Usage-Based ;其余情况为 Other |
ChargePeriodEnd | 日期 | 为独占结束日期添加一天 |
ChargePeriodStart | 日期 | 无 |
CommitmentDiscountCategory | BenefitId | 如果 BenefitId 包含 /microsoft.capacity/ (不区分大小写),则为 Usage ;如果它包含 /microsoft.billingbenefits/ ,则使用 Spend ;其余情况为 null |
CommitmentDiscountId | BenefitId | 无 |
CommitmentDiscountName | BenefitName | 无 |
CommitmentDiscountStatus | ChargeType | 如果是 UnusedReservation 或 UnusedSavingsPlan ,则为 Unused ;否则,如果 PricingModel == Reservation 或 SavingsPlan ,则为 Used ;其余情况为 null |
CommitmentDiscountType | BenefitId | 如果 BenefitId 包含 /microsoft.capacity/ (不区分大小写),则为 Reservation ;如果它包含 /microsoft.billingbenefits/ ,则为 Savings Plan ;其余情况为 null |
ConsumedQuantity | 数量 | 如果 ChargeType == Usage ,则为“数量”;其余情况为 null |
ConsumedUnit | UnitOfMeasure | 如果 ChargeType == Usage ,则使用定价单位数据文件进行映射;其余情况为 null |
ContractedCost | UnitPrice * Quantity / focus:x_PricingBlockSize | 请注意,x_PricingBlockSize需要映射。 有关详细信息,请参阅列说明。 |
ContractedUnitPrice | UnitPrice | 无 |
EffectiveCost | CostInBillingCurrency | 如果 ChargeType == “Purchase” 或 “Refund”,并且 PricingModel == “Reservation” 或 “SavingsPlan”,则 0 ;否则,请使用 CostInBillingCurrency。 |
InvoiceIssuerName | PartnerName | 如果 PartnerName 为空,请使用 Microsoft |
ListCost | • 企业协议:不可用 • Microsoft 客户协议:PaygCostInBillingCurrency |
无 |
ListUnitPrice | • 企业协议:PayGPrice • Microsoft 客户协议:PayGPrice * ExchangeRate |
无 |
PricingCategory | PricingModel | 如果是 OnDemand ,则为 Standard ;如果是 Spot ,则为 Dynamic ;如果是 Reservation 或 Savings Plan ,则为 Committed ;其余情况为 null |
PricingQuantity | Quantity / focus:x_PricingBlockSize | 请注意,x_PricingBlockSize需要映射。 有关详细信息,请参阅列说明。 |
PricingUnit | DistinctUnits(查找) | 使用定价单位数据文件将 UnitOfMeasure 映射到 DistinctUnits |
ProviderName | Microsoft |
无 |
PublisherName | PublisherName | 无 |
RegionId | focus:RegionName | 小写和移除空格 |
RegionName | ResourceLocation | 使用区域数据文件2将 ResourceLocation (OriginalValue) 映射到 RegionName |
ResourceId | ResourceId | 无 |
ResourceName | EA:ResourceName MCA:last(split(ResourceId, "/")) |
Azure 资源名称包括多个级别(例如“SqlServerName/SqlDbName”),这需要更多的处理。 这是一种简化的方法,仅使用最后一个最具体的段。 |
ResourceType | SingularDisplayName(查找) | 使用资源类型数据文件将 ResourceType 映射到 SingularDisplayName |
ServiceCategory | ServiceCategory(查找) | 使用服务数据文件将 ConsumedService 和 ResourceType 映射到 ServiceCategory |
ServiceName | ServiceName(查找) | 使用服务数据文件将 ConsumedService 和 ResourceType 映射到 ServiceName |
SkuId | • 企业协议:不可用 • Microsoft客户协议:ProductId |
无 |
SkuPriceId | 不可用 | 无 |
SubAccountId | SubscriptionId | 无 |
SubAccountName | SubscriptionName | 无 |
标记 | 标记 | 包装在 { 和 } 中(如果需要) |
¹ 成本管理中的“数量”指的是已消耗(使用)数量。
² 虽然 RegionName 是 ResourceLocation 的直接映射,但成本管理和 FinOps 工具包报告还会进行额外的数据清理,以确保基于区域数据文件的值的一致性。
有关 FOCUS 列的反馈
如果你有关于映射或完整 FOCUS 支持计划的反馈,请在 FinOps 工具包讨论中启动会话。 如果你认为存在 bug,请创建问题。
如果你有有关 FOCUS 的反馈,请在 FOCUS 存储库中创建问题。 我们还鼓励你考虑参与 FOCUS 项目。 该项目正在寻找更多的从业者,利用他们的经验来帮助指导工作,使其成为最有用的规范。 若要详细了解 FOCUS 或要参与项目,请访问 focus.finops.org。
相关内容
相关资源:
相关产品:
相关解决方案: