'Set the machine id of the VM for guest tools to pick up
and reconfigure the network interfaces.'

def _set_machine_id(self, client_factory, instance, network_info, vm_ref=None):

    if (vm_ref is None):
        vm_ref = vm_util.get_vm_ref(self._session, instance)
    machine_id_change_spec = vm_util.get_machine_id_change_spec(client_factory, self._get_machine_id_str(network_info))
    LOG.debug('Reconfiguring    VM    instance    to    set    the    machine    id', instance=instance)
    vm_util.reconfigure_vm(self._session, vm_ref, machine_id_change_spec)
    LOG.debug('Reconfigured    VM    instance    to    set    the    machine    id', instance=instance)
