Cloud Accounting

EGI Cloud Accounting record and message formats

Individual VM Records and Messages

APEL-cloud-message: v0.4

The header only appears once at the top of each message (that is once at the top of each file). It defines the type of record and the schema version.

Record Fields

The federated cloud task force has agreed on a Cloud Usage Record, which inherits from the OGF Usage Record (GFD.204). This record defines the data that resource providers must send to EGI’s central Accounting repository.

Version 0.4 of the Cloud Accounting Usage Record was agreed at the FedCloud Face to Face in Amsterdam in January 2015. A summary table of the format is shown below:

Cloud Usage Record PropertyTypeNullDefinition
VMUUIDvarchar(255)NoVirtual Machine's Universally Unique Identifier concatenation of CurrentTime, SiteName and MachineName
SiteNamevarchar(255)NoGOCDB SiteName - GOCDB now has cloud service types and a cloud-only site is allowed.
CloudComputeService (NEW)varchar(255)Name identifying cloud resource within the site. Allows multiple cloud resources within a site, i.e. a level of granularity.
MachineNamevarchar(255)NoVM ID - the site name for the VM
LocalUserIdvarchar(255)Local username
LocalGroupIdvarchar(255)Local group name
GlobalUserNamevarchar(255)Global identity of user (certificate DN)
FQANvarchar(255)Use if VOs part of authorization mechanism
Statusvarchar(255)Completion status - completed, started or suspended
StartTimedatetimeMust be set when Status = started
EndTimedatetimeSet to NULL until Status = completed
SuspendDurationdatetimeSet when Status = suspended (Timestamp)
WallDurationintWallClock time - actual time used
CpuDurationintCPU time consumed (Duration)
CpuCountintNumber of CPUs allocated
NetworkTypevarchar(255)Needs clarifying
NetworkInboundintGB received
NetworkOutboundintGB sent
PublicIPCount (NEW)intNumber of public IP addresses assigned to VM Not used.
MemoryintMemory allocated to the VM
DiskintSize in GB allocated to the VM
BenchmarkType (NEW)varchar(255)Name of benchmark used for normalization of times (eg HEPSPEC06)
Benchmark (NEW)DecimalValue of benchmark of VM using ServiceLevelType benchmark’
StorageRecordIdvarchar(255)Link to other associated storage record Need to check feasibility
ImageIdvarchar(255)Every image has a unique ID associated with it. For images from the Artecfact Registry this should be VMCATCHER_EVENT_AD_MPURI; for images from other repositories it should be an equivalent; for local images - local identifier of the image.
CloudTypevarchar(255)Type of cloud infrastructure: OpenNebula; OpenStack; Synnefo; etc.

Message

End of record

%%

Example Message

APEL-cloud-message: v0.4
SiteName: SAMPLE-SITE
CloudComputeService: host.example.com
CloudType: caso/5.2.1 (OpenStack)
CpuCount: 2
CpuDuration: 31359976
Disk: 80
EndTime: 0
FQAN: vo.sample.org
LocalGroupId: foo-bar
LocalUserId: baz
MachineName: vm-name
Memory: 4096
PublicIPCount: 1
StartTime: 1764592012
Status: started
VMUUID: 12345678-1234-5678-9012-123456789012
WallDuration: 15679988
%%
...another VM record...
%%
...
%%

IP Records

The fedcloud task force has agreed on a Public IP Usage Record. The format uses many of the same fields as the Cloud Usage Record. The Usage Record should be a snapshot of the number of IPs currently assigned to a user. A table defining v0.2 of the format is shown below:

Cloud Usage Record PropertyTypeNullDefinitionNotes
MeasurementTimedatetimeNoThe time the usage was recorded.In the message format, must be a UNIX timestamp, i.e. the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970)
SiteNamevarchar(255)NoThe GOCDB site assigning the IP
CloudComputeServicevarchar(255)YesSee Cloud Usage Record
CloudTypevarchar(255)NoSee Cloud Usage Record
LocalUservarchar(255)NoSee Cloud Usage Record
LocalGroupvarchar(255)NoSee Cloud Usage Record
GlobalUserNamevarchar(255)NoSee Cloud Usage Record
FQANvarchar(255)NoSee Cloud Usage Record
IPVersionbyteNo4 or 6
IPCountint(11)NoThe number of IP addresses of IPVersion this user currently assigned to them

A JSON schema defining a valid Public IP Usage message can be found at: https://github.com/apel/apel/blob/9476bd86424f6162c3b87b6daf6b4270ceb8fea6/apel/db/__init__.py

GPU Records

The fedcloud task force has agreed on an GPU Usage Record. The format uses many of the same fields as the Cloud Usage Record. A table defining Draft 4 – 24/02/2021 is shown below:

GPU Usage Record PropertyTypeNullDefinition
MeasurementMonthintNoThe month/year the reported usage should be assigned to. If the month/year is the current month/year, the usage should be up to the point of reporting.
MeasurementYearintNo
AssociatedRecordTypevarchar(255)NoThe context in which the reported usage was used. I.e. “cloud” for an accelerator attached to a VM.
AssociatedRecordvarchar(255)NoVMUUID if AssociatedRecordType is “cloud”
GlobalUserNamevarchar(255)YesSee the definition of your AssociatedRecordType
FQANvarchar(255)NoSee the definition of your AssociatedRecordType
SiteNamevarchar(255)NoSee the definition of your AssociatedRecordType
CountdecimalNoA count of the Accelerators attached to the VM. At the moment Accelerators are not shared among VMs but it will change when Accelerator virtualization is applied, so we should have the field at decimal type instead of integer (e.g. Count = 0.5 when it is shared between two VMs).
Coresint(11)YesTotal number of cores. i.e. So if an Accelerator has 64 cores and a VM has 2 like that attached then we would report: Count=2 and Processors=128
ActiveDurationint(11)YesActual usage duration of the Accelerator in seconds for the given month/year (in case some systems could report actual usage). At the moment, ActiveDuration will be the same as the AvailableDuration due to the limitation of currently used technologies (impossible to get ACCELERATOR utilization from outside of the VM, no ACCELERATOR hot-plug into running VM) but it may change in near future so it is good to have the fields separately. Set to AvailableDuration if ActiveDuration is omitted from the record
AvailableDurationint(11)NoTime accelerator was available in seconds for the given month/year (Wall)Time that a GPU was attached to a VM.
BenchmarkTypevarchar(255)YesName of benchmark used for normalization of times
BenchmarkdecimalYesValue of benchmark of Accelerator
Typevarchar(255)NoHigh level description of accelerator, i.e. GPU, FPGA, Other
Modelvarchar(255)Yesmodel number, spec, some other concept that 2 ACCELERATORs with the same number of cores might be different etc

Sample message

Records are sent as a json payload as shown in the following sample:

{
  "Type": "APEL-accelerator-message",
  "Version": "0.1",
  "UsageRecords": [
    {
      "SiteName": "SAMPLE-SITE",
      "CloudType": "caso/5.2.1 (OpenStack)",
      "CloudComputeService": "host.example.com",
      "AssociatedRecord": "12345678-1234-5678-9012-123456789012",
      "FQAN": "vo.sample.org",
      "Count": 4,
      "AvailableDuration": 2592000,
      "MeasurementMonth": 4,
      "MeasurementYear": 2026,
      "AssociatedRecordType": "cloud",
      "Type": "GPU",
      "Model": "NVIDIA Tesla V100",
      "ActiveDuration": 2592000
    },
    { ... another GPU record ... }
  ]
}