mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-04 15:25:09 +00:00
auto generate uuid on VM create
Other VM environments also generates an UUID by default.
This commit is contained in:
parent
d7fd6a445b
commit
47314bf5e2
@ -4,6 +4,7 @@ use strict;
|
||||
use warnings;
|
||||
use Cwd 'abs_path';
|
||||
use Net::SSLeay;
|
||||
use UUID;
|
||||
|
||||
use PVE::Cluster qw (cfs_read_file cfs_write_file);;
|
||||
use PVE::SafeSyslog;
|
||||
@ -431,6 +432,14 @@ __PACKAGE__->register_method({
|
||||
$conf->{bootdisk} = $firstdisk;
|
||||
}
|
||||
|
||||
# auto generate uuid if user did not specify smbios1 option
|
||||
if (!$conf->{smbios1}) {
|
||||
my ($uuid, $uuid_str);
|
||||
UUID::generate($uuid);
|
||||
UUID::unparse($uuid, $uuid_str);
|
||||
$conf->{smbios1} = "uuid=$uuid_str";
|
||||
}
|
||||
|
||||
PVE::QemuServer::update_config_nolock($vmid, $conf);
|
||||
|
||||
};
|
||||
|
@ -3,7 +3,7 @@ Version: @@VERSION@@-@@PKGRELEASE@@
|
||||
Section: admin
|
||||
Priority: optional
|
||||
Architecture: @@ARCH@@
|
||||
Depends: libc6 (>= 2.7-18), perl (>= 5.10.0-19), libterm-readline-gnu-perl, pve-qemu-kvm (>= 1.7-1), netcat-traditional, libpve-access-control, libpve-storage-perl, pve-cluster, redhat-cluster-pve, libjson-perl, libjson-xs-perl, libio-multiplex-perl, libnet-ssleay-perl, socat, pve-firewall
|
||||
Depends: libc6 (>= 2.7-18), perl (>= 5.10.0-19), libterm-readline-gnu-perl, pve-qemu-kvm (>= 1.7-1), netcat-traditional, libpve-access-control, libpve-storage-perl, pve-cluster, redhat-cluster-pve, libjson-perl, libjson-xs-perl, libio-multiplex-perl, libnet-ssleay-perl, socat, pve-firewall, libuuid-perl
|
||||
Conflicts: netcat-openbsd
|
||||
Maintainer: Proxmox Support Team <support@proxmox.com>
|
||||
Description: Qemu Server Tools
|
||||
|
Loading…
Reference in New Issue
Block a user