Is there an API under KVM to get ZoneID?

When using Zoning in Solaris, the host code does not change by zone, but you also get (by calling the getoneid () function) a unique zoneid for your zone.

Using KVM under Linux, the hobbies change (increases) in the zone - which is pretty good, but it's not perfect - you may run into someone elses hostid.

Is there an API provided by KVM that allows me to get the zone?

+5
source share
1 answer

As for your problems with duplicate hosts:

Solaris, ​​Linux "gethostid". "gethostid" ( /usr/bin/hostid) glibc, :

  • , (/etc/hostid ); , 4- ;
  • hostid IP- ;
  • hostid 0.

, IP-, .

IP-, hostid, sethostid glibc ( , (1) glibc gethostid ).

zoneid KVM:

Solaris ( ), KVM Linux, . , Solaris zoneid , Linux Linux.

KVM, :

  • IP-/, ;

  • / UUID , uuidgen, . UUID UUID ;

  • ( -append KVM). /proc/cmdline.

+3

All Articles