]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/QemuServer.pm
start: always stop an existing $vmid.scope
[qemu-server.git] / PVE / QemuServer.pm
index 1da226c8ec8d5b29d464cb173b420b38e4ba0909..7d0f65c7377ecf73353b92cf7a091e4bfc9b7239 100644 (file)
@@ -543,7 +543,7 @@ my $confdesc_cloudinit = {
     citype => {
        optional => 1,
        type => 'string',
-       description => 'Specifies the cloud-init configuration format.',
+       description => 'Specifies the cloud-init configuration format. The default depends on the configured operating system type (`ostype`. We use the `nocloud` format for Linux, and `configdrive2` for windows.',
        enum => ['configdrive2', 'nocloud'],
     },
     ciuser => {
@@ -554,8 +554,7 @@ my $confdesc_cloudinit = {
     cipassword => {
        optional => 1,
        type => 'string',
-       description => 'cloud-init: Password to assign the user. Using this is generally not recommended. Use ssh keys instead. '
-                    . 'Also note that older cloud-init versions do not support hashed passwords.',
+       description => 'cloud-init: Password to assign the user. Using this is generally not recommended. Use ssh keys instead. Also note that older cloud-init versions do not support hashed passwords.',
     },
     searchdomain => {
        optional => 1,
@@ -571,8 +570,7 @@ my $confdesc_cloudinit = {
        optional => 1,
        type => 'string',
        format => 'urlencoded',
-       description => "cloud-init : Setup public SSH keys (one key per line, " .
-                       "OpenSSH format).",
+       description => "cloud-init: Setup public SSH keys (one key per line, OpenSSH format).",
     },
 };
 
@@ -4896,10 +4894,11 @@ sub vm_start {
 
        PVE::Storage::activate_volumes($storecfg, $vollist);
 
-       if (!check_running($vmid, 1) && -d "/sys/fs/cgroup/systemd/qemu.slice/$vmid.scope") {
-           my $cmd = [];
-           push @$cmd, '/bin/systemctl', 'stop', "$vmid.scope";
-           eval  { run_command($cmd); };
+       if (!check_running($vmid, 1)) {
+           eval {
+               run_command(['/bin/systemctl', 'stop', "$vmid.scope"],
+                   outfunc => sub {}, errfunc => sub {});
+           };
        }
 
        my $cpuunits = defined($conf->{cpuunits}) ? $conf->{cpuunits}