Comment 11 for bug 1661693

Revision history for this message
Neil Wilson (neil-aldur) wrote :

The system serial number is empty under KVM and exposed in the sysfs, so I propose putting the fqdn of the server into that field.

That way you can pick up a Brightbox cloud server fairly easily:

with open('/sys/devices/virtual/dmi/id/product_serial', 'r') as content_file:
    content = content_file.read()

if content.rstrip().endswith(".brightbox.com"):
    print("Brightbox VM")
else:
    print("Not a Brightbox VM")