0

We are currently doing fact finding in microsoft azure. For one of our software stacks, having known UUIDs is important (defined as the output from dmidecode|grep UUID).

In virtualbox/vagrant, it is possible to force a specific UUID on to a vm using something like this in the vagrantfile:

  config.vm.define :"box01" do |box01|
    box01.vm.box = BOX
    box01.vm.network :private_network, ip:"192.168.57.140"
    box01.vm.hostname = "box01"
    box01.vm.provider :virtualbox do |vb|
      vb.customize ['setextradata', :id, 'VBoxInternal/Devices/pcbios/0/Config/DmiSystemUuid',      '564DA11D-1112-7C62-2119-8E461180AE4A']
    end
  end

Inside ovirt there is a similar capability to force the UUID using the RESTful API, which we hardcode for all of our VMs.

Does such a capability exist within Azure?

Matthew
  • 2,737
  • 8
  • 35
  • 51
  • Have you considered putting in a front-end script that replaces the UUID line output by `dmidecode` with the needed value? – doneal24 Apr 16 '23 at 17:47
  • Sadly we have an installer which directly invokes dmidecode which is what we need to work around. Could you provide an example of such a script? – Matthew Apr 17 '23 at 14:27

1 Answers1

0

Maybe not a real answer but this should work after the system is running.

# mv -f /bin/dmidecode /bin/dmidecode.real
# cat > /bin/dmidecode <<EOF
#!/bin/bash
/bin/dmidecode.real “$@“ | sed ‘s:/^\s*UUID.*/UUID: 564DA11D-1112-7C62-2119-8E461180AE4A/‘
EOF
# chmod 0755 /bin/dmidecode 

You can play with the regex to fix spaces if necessary.

doneal24
  • 851
  • 6
  • 14