properties => {
node => get_standard_option('pve-node'),
vmid => get_standard_option('pve-vmid', { completion => \&PVE::LXC::complete_ctid_stopped }),
+ skiplock => get_standard_option('skiplock'),
},
},
returns => {
my $vmid = extract_param($param, 'vmid');
+ my $skiplock = extract_param($param, 'skiplock');
+ raise_param_exc({ skiplock => "Only root may use this option." })
+ if $skiplock && $authuser ne 'root@pam';
+
die "CT $vmid already running\n" if PVE::LXC::check_running($vmid);
PVE::Cluster::check_cfs_quorum();
die "you can't start a CT if it's a template\n"
if PVE::LXC::is_template($conf);
- PVE::LXC::check_lock($conf);
+ PVE::LXC::check_lock($conf) if !$skiplock;
my $storage_cfg = cfs_read_file("storage.cfg");
PVE::LXC::update_lxc_config($storage_cfg, $vmid, $conf);
+ local $ENV{PVE_SKIPLOCK}=1 if $skiplock;
+
my $cmd = ['lxc-start', '-n', $vmid];
run_command($cmd);
properties => {
node => get_standard_option('pve-node'),
vmid => get_standard_option('pve-vmid', { completion => \&PVE::LXC::complete_ctid_running }),
+ skiplock => get_standard_option('skiplock'),
},
},
returns => {
my $vmid = extract_param($param, 'vmid');
+ my $skiplock = extract_param($param, 'skiplock');
+ raise_param_exc({ skiplock => "Only root may use this option." })
+ if $skiplock && $authuser ne 'root@pam';
+
die "CT $vmid not running\n" if !PVE::LXC::check_running($vmid);
if (PVE::HA::Config::vm_is_ha_managed($vmid) && $rpcenv->{type} ne 'ha') {
my $conf = PVE::LXC::load_config($vmid);
- PVE::LXC::check_lock($conf);
+ PVE::LXC::check_lock($conf) if !$skiplock;
my $cmd = ['lxc-stop', '-n', $vmid, '--kill'];