Skip to content

Instantly share code, notes, and snippets.

@ggrandes
Created March 4, 2014 19:03
Show Gist options
  • Save ggrandes/9353295 to your computer and use it in GitHub Desktop.
Save ggrandes/9353295 to your computer and use it in GitHub Desktop.
Get Linux System UID
# Works on any machine with 1 ethernet (eth0)
cat /sys/class/net/eth0/address
# Works on { VMWARE, Baremetal, KVM (if setted with -uuid %s) }, Fail on { AWS/XEN }
cat /sys/devices/virtual/dmi/id/product_uuid
dmidecode -s system-uuid
# Works on { VMWARE, Baremetal }, Fail on { AWS/XEN, KVM }
cat /sys/devices/virtual/dmi/id/product_serial
# Works on { AWS/XEN }, Fail on { VMWARE, Baremetal, KVM }
cat /sys/hypervisor/uuid
curl http://169.254.169.254/latest/meta-data/instance-id
@errordeveloper
Copy link

It's no longer the case with AWS, please see the testing we did to improve Weave Net.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment