Add uuid to facts
For physical HW that would be unique chassis id (from BIOS settings). For kvm guests that would be virsh domain uuid. Used with fence_virsh agent. For other hypervizors - not tested. Implements: blueprint facter-uuid Change-Id: Idd92a3e0dc41040c76243f92fa84e14b9da03b6d Signed-off-by: Bogdan Dobrelya <bogdando@mail.ru> Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
parent
1f4cf2ef23
commit
a641e5dcad
10
bin/agent
10
bin/agent
|
@ -314,10 +314,20 @@ class NodeAgent
|
|||
@os[:dmi][:system][:serial_number].strip rescue nil
|
||||
end
|
||||
|
||||
# Returns unique identifier of machine
|
||||
# * for kvm virtual node will contain virsh UUID
|
||||
# * for physical HW that would be unique chassis id (from BIOS settings)
|
||||
# * for other hypervizors - not tested
|
||||
def uuid
|
||||
node_uuid = @os.fetch(:dmi, {}).fetch(:system, {}).fetch(:uuid, nil)
|
||||
node_uuid && node_uuid.strip
|
||||
end
|
||||
|
||||
def _system_info
|
||||
{
|
||||
:manufacturer => _manufacturer,
|
||||
:serial => _serial,
|
||||
:uuid => uuid,
|
||||
:product => _product_name,
|
||||
:family => (@os[:dmi][:system][:family].strip rescue nil),
|
||||
:version => (@os[:dmi][:system][:version].strip rescue nil),
|
||||
|
|
Loading…
Reference in New Issue