]>
git.proxmox.com Git - pve-container.git/blob - src/PVE/CLI/pct.pm
11 use PVE
::Tools
qw(extract_param);
15 use PVE
::RPCEnvironment
;
16 use PVE
::JSONSchema
qw(get_standard_option);
19 use PVE
::API2
::LXC
::Config
;
20 use PVE
::API2
::LXC
::Status
;
21 use PVE
::API2
::LXC
::Snapshot
;
25 use base
qw(PVE::CLIHandler);
27 my $nodename = PVE
::INotify
::nodename
();
31 my $status = PVE
::Tools
::upid_read_status
($upid);
32 exit($status eq 'OK' ?
0 : -1);
35 sub setup_environment
{
36 PVE
::RPCEnvironment-
>setup_default_cli_env();
39 __PACKAGE__-
>register_method ({
43 description
=> "Show CT status.",
45 additionalProperties
=> 0,
47 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
49 description
=> "Verbose output format",
55 returns
=> { type
=> 'null'},
60 my $conf = PVE
::LXC
::Config-
>load_config ($param->{vmid
});
62 my $vmstatus = PVE
::LXC
::vmstatus
($param->{vmid
});
63 my $stat = $vmstatus->{$param->{vmid
}};
64 if ($param->{verbose
}) {
65 foreach my $k (sort (keys %$stat)) {
71 my $status = $stat->{status
} || 'unknown';
72 print "status: $status\n";
83 PVE
::CLIHandler
::get_standard_mapping
('pve-password'),
88 return $mapping->{$name};
91 __PACKAGE__-
>register_method ({
95 description
=> "Unlock the VM.",
97 additionalProperties
=> 0,
99 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
102 returns
=> { type
=> 'null'},
106 my $vmid = $param->{vmid
};
108 PVE
::LXC
::Config-
>remove_lock($vmid);
113 __PACKAGE__-
>register_method ({
117 description
=> "Launch a console for the specified container.",
119 additionalProperties
=> 0,
121 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid_running
}),
123 description
=> "Escape sequence prefix. For example to use <Ctrl+b q> as the escape sequence pass '^b'.",
126 pattern
=> '\^?[a-z]',
131 returns
=> { type
=> 'null' },
136 # test if container exists on this node
137 my $conf = PVE
::LXC
::Config-
>load_config($param->{vmid
});
139 my $cmd = PVE
::LXC
::get_console_command
($param->{vmid
}, $conf, $param->{escape
});
143 __PACKAGE__-
>register_method ({
147 description
=> "Launch a shell for the specified container.",
149 additionalProperties
=> 0,
151 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid_running
}),
154 returns
=> { type
=> 'null' },
159 my $vmid = $param->{vmid
};
161 # test if container exists on this node
162 PVE
::LXC
::Config-
>load_config($vmid);
164 die "Error: container '$vmid' not running!\n" if !PVE
::LXC
::check_running
($vmid);
166 exec('lxc-attach', '-n', $vmid);
169 __PACKAGE__-
>register_method ({
173 description
=> "Launch a command inside the specified container.",
175 additionalProperties
=> 0,
177 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid_running
}),
178 'extra-args' => get_standard_option
('extra-args'),
181 returns
=> { type
=> 'null' },
186 # test if container exists on this node
187 PVE
::LXC
::Config-
>load_config($param->{vmid
});
189 if (!@{$param->{'extra-args'}}) {
190 die "missing command";
192 exec('lxc-attach', '-n', $param->{vmid
}, '--', @{$param->{'extra-args'}});
195 __PACKAGE__-
>register_method ({
199 description
=> "Run a filesystem check (fsck) on a container volume.",
201 additionalProperties
=> 0,
203 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid_stopped
}),
207 description
=> "Force checking, even if the filesystem seems clean",
213 description
=> "A volume on which to run the filesystem check",
214 enum
=> [PVE
::LXC
::Config-
>mountpoint_names()],
218 returns
=> { type
=> 'null' },
222 my $vmid = $param->{'vmid'};
223 my $device = defined($param->{'device'}) ?
$param->{'device'} : 'rootfs';
225 my $command = ['fsck', '-a', '-l'];
226 push(@$command, '-f') if $param->{force
};
228 # critical path: all of this will be done while the container is locked
231 my $conf = PVE
::LXC
::Config-
>load_config($vmid);
232 my $storage_cfg = PVE
::Storage
::config
();
234 defined($conf->{$device}) || die "cannot run command on non-existing mount point $device\n";
236 my $mount_point = $device eq 'rootfs' ? PVE
::LXC
::Config-
>parse_ct_rootfs($conf->{$device}) :
237 PVE
::LXC
::Config-
>parse_ct_mountpoint($conf->{$device});
239 my $volid = $mount_point->{volume
};
242 my $storage_id = PVE
::Storage
::parse_volume_id
($volid, 1);
245 my (undef, undef, undef, undef, undef, undef, $format) =
246 PVE
::Storage
::parse_volname
($storage_cfg, $volid);
248 die "unable to run fsck for '$volid' (format == $format)\n"
251 $path = PVE
::Storage
::path
($storage_cfg, $volid);
254 if (($volid =~ m
|^/.+|) && (-b
$volid)) {
255 # pass block devices directly
258 die "path '$volid' does not point to a block device\n";
262 push(@$command, $path);
264 PVE
::LXC
::check_running
($vmid) &&
265 die "cannot run fsck on active container\n";
267 PVE
::Tools
::run_command
($command);
270 PVE
::LXC
::Config-
>lock_config($vmid, $do_fsck);
274 __PACKAGE__-
>register_method({
278 description
=> "Mount the container's filesystem on the host. " .
279 "This will hold a lock on the container and is meant for emergency maintenance only " .
280 "as it will prevent further operations on the container other than start and stop.",
282 additionalProperties
=> 0,
284 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
287 returns
=> { type
=> 'null' },
291 my $rpcenv = PVE
::RPCEnvironment
::get
();
293 my $vmid = extract_param
($param, 'vmid');
294 my $storecfg = PVE
::Storage
::config
();
295 PVE
::LXC
::Config-
>lock_config($vmid, sub {
296 my $conf = PVE
::LXC
::Config-
>set_lock($vmid, 'mounted');
297 PVE
::LXC
::mount_all
($vmid, $storecfg, $conf);
300 print "mounted CT $vmid in '/var/lib/lxc/$vmid/rootfs'\n";
304 __PACKAGE__-
>register_method({
308 description
=> "Unmount the container's filesystem.",
310 additionalProperties
=> 0,
312 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
315 returns
=> { type
=> 'null' },
319 my $rpcenv = PVE
::RPCEnvironment
::get
();
321 my $vmid = extract_param
($param, 'vmid');
322 my $storecfg = PVE
::Storage
::config
();
323 PVE
::LXC
::Config-
>lock_config($vmid, sub {
324 my $conf = PVE
::LXC
::Config-
>load_config($vmid);
325 PVE
::LXC
::umount_all
($vmid, $storecfg, $conf, 0);
326 PVE
::LXC
::Config-
>remove_lock($vmid, 'mounted');
331 __PACKAGE__-
>register_method({
335 description
=> "Get the container's current disk usage.",
337 additionalProperties
=> 0,
339 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
342 returns
=> { type
=> 'null' },
346 my $rpcenv = PVE
::RPCEnvironment
::get
();
348 # JSONSchema's format_size is exact, this uses floating point numbers
351 return $size if $size < 1024.;
353 return sprintf('%.1fK', ${size
}) if $size < 1024.;
355 return sprintf('%.1fM', ${size
}) if $size < 1024.;
357 return sprintf('%.1fG', ${size
}) if $size < 1024.;
359 return sprintf('%.1fT', ${size
}) if $size < 1024.;
362 my $vmid = extract_param
($param, 'vmid');
363 PVE
::LXC
::Config-
>lock_config($vmid, sub {
364 my $pid = eval { PVE
::LXC
::find_lxc_pid
($vmid) };
365 my ($conf, $rootdir, $storecfg, $mounted);
367 $conf = PVE
::LXC
::Config-
>set_lock($vmid, 'mounted');
368 $rootdir = "/var/lib/lxc/$vmid/rootfs";
369 $storecfg = PVE
::Storage
::config
();
370 PVE
::LXC
::mount_all
($vmid, $storecfg, $conf);
373 $conf = PVE
::LXC
::Config-
>load_config($vmid);
374 $rootdir = "/proc/$pid/root";
377 my @list = [qw(MP Volume Size Used Avail Use% Path)];
378 my @len = map { length($_) } @{$list[0]};
381 PVE
::LXC
::Config-
>foreach_mountpoint($conf, sub {
382 my ($name, $mp) = @_;
383 my $path = $mp->{mp
};
385 my $df = PVE
::Tools
::df
("$rootdir/$path", 3);
386 my $total = $format->($df->{total
});
387 my $used = $format->($df->{used
});
388 my $avail = $format->($df->{avail
});
390 my $pc = sprintf('%.1f', $df->{used
}/$df->{total
});
392 my $entry = [ $name, $mp->{volume
}, $total, $used, $avail, $pc, $path ];
395 foreach my $i (0..5) {
396 $len[$i] = length($entry->[$i])
397 if $len[$i] < length($entry->[$i]);
401 my $format = "%-$len[0]s %-$len[1]s %$len[2]s %$len[3]s %$len[4]s %$len[5]s %s\n";
402 printf($format, @$_) foreach @list;
407 PVE
::LXC
::umount_all
($vmid, $storecfg, $conf, 0);
408 PVE
::LXC
::Config-
>remove_lock($vmid, 'mounted');
414 # File creation with specified ownership and permissions.
415 # User and group can be names or decimal numbers.
416 # Permissions are explicit (not affected by umask) and can be numeric with the
417 # usual 0/0x prefixes for octal/hex.
419 my ($path, $perms, $user, $group) = @_;
421 if (defined($user)) {
422 if ($user =~ /^\d+$/) {
425 $uid = getpwnam($user) or die "failed to get uid for: $user\n"
428 if (defined($group)) {
429 if ($group =~ /^\d+$/) {
432 $gid = getgrnam($group) or die "failed to get gid for: $group\n"
436 if (defined($perms)) {
438 my ($mode, $unparsed) = POSIX
::strtoul
($perms, 0);
439 die "invalid mode: '$perms'\n" if $perms eq '' || $unparsed > 0 || $!;
444 if (sysopen($fd, $path, O_WRONLY
| O_CREAT
| O_EXCL
, 0)) {
445 $perms = 0666 & ~umask if !defined($perms);
447 # If the path previously existed then we do not care about left-over
448 # file descriptors even if the permissions/ownership is changed.
449 sysopen($fd, $path, O_WRONLY
| O_CREAT
| O_TRUNC
)
450 or die "failed to create file: $path: $!\n";
455 if (defined($perms)) {
460 if (defined($uid) || defined($gid)) {
462 my ($fuid, $fgid) = (stat($fd))[4,5] if !defined($uid) || !defined($gid);
463 $uid = $fuid if !defined($uid);
464 $gid = $fgid if !defined($gid);
465 chown($uid, $gid, $fd)
466 or die "failed to change file owner: $!\n";
471 __PACKAGE__-
>register_method ({
475 description
=> "Rescan all storages and update disk sizes and unused disk images.",
477 additionalProperties
=> 0,
479 vmid
=> get_standard_option
('pve-vmid', {
481 completion
=> \
&PVE
::LXC
::complete_ctid
,
487 description
=> 'Do not actually write changes out to conifg.',
491 returns
=> { type
=> 'null'},
495 my $dryrun = $param->{dryrun
};
497 print "NOTE: running in dry-run mode, won't write changes out!\n" if $dryrun;
499 PVE
::LXC
::rescan
($param->{vmid
}, 0, $dryrun);
504 __PACKAGE__-
>register_method({
508 description
=> "Copy a file from the container to the local system.",
510 additionalProperties
=> 0,
512 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
515 description
=> "Path to a file inside the container to pull.",
519 description
=> "Destination",
523 description
=> 'Owner user name or id.',
528 description
=> 'Owner group name or id.',
533 description
=> "File permissions to use (octal by default, prefix with '0x' for hexadecimal).",
540 description
=> "the task ID.",
545 my $rpcenv = PVE
::RPCEnvironment
::get
();
547 my $vmid = extract_param
($param, 'vmid');
548 my $path = extract_param
($param, 'path');
549 my $dest = extract_param
($param, 'destination');
551 my $perms = extract_param
($param, 'perms');
552 # assume octal as default
553 $perms = "0$perms" if defined($perms) && $perms !~m/^0/;
554 my $user = extract_param
($param, 'user');
555 my $group = extract_param
($param, 'group');
558 my $running = PVE
::LXC
::check_running
($vmid);
559 die "can only pull files from a running VM" if !$running;
562 my $pid = PVE
::LXC
::find_lxc_pid
($vmid);
563 # Avoid symlink issues by opening the files from inside the
564 # corresponding namespaces.
565 my $destfd = create_file
($dest, $perms, $user, $group);
567 sysopen my $mntnsfd, "/proc/$pid/ns/mnt", O_RDONLY
568 or die "failed to open the container's mount namespace\n";
569 PVE
::Tools
::setns
(fileno($mntnsfd), PVE
::Tools
::CLONE_NEWNS
)
570 or die "failed to enter the container's mount namespace\n";
572 chdir('/') or die "failed to change to container root directory\n";
574 open my $srcfd, '<', $path
575 or die "failed to open $path: $!\n";
577 copy
($srcfd, $destfd);
580 # This avoids having to setns() back to our namespace.
581 return $rpcenv->fork_worker('pull_file', $vmid, undef, $realcmd);
584 return PVE
::LXC
::Config-
>lock_config($vmid, $code);
587 __PACKAGE__-
>register_method({
591 description
=> "Copy a local file to the container.",
593 additionalProperties
=> 0,
595 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
598 description
=> "Path to a local file.",
602 description
=> "Destination inside the container to write to.",
606 description
=> 'Owner user name or id. When using a name it must exist inside the container.',
611 description
=> 'Owner group name or id. When using a name it must exist inside the container.',
616 description
=> "File permissions to use (octal by default, prefix with '0x' for hexadecimal).",
623 description
=> "the task ID.",
628 my $rpcenv = PVE
::RPCEnvironment
::get
();
630 my $vmid = extract_param
($param, 'vmid');
631 my $file = extract_param
($param, 'file');
632 my $dest = extract_param
($param, 'destination');
634 my $perms = extract_param
($param, 'perms');
635 # assume octal as default
636 $perms = "0$perms" if defined($perms) && $perms !~m/^0/;
637 my $user = extract_param
($param, 'user');
638 my $group = extract_param
($param, 'group');
641 my $running = PVE
::LXC
::check_running
($vmid);
642 die "can only push files to a running CT\n" if !$running;
644 my $conf = PVE
::LXC
::Config-
>load_config($vmid);
645 my $unprivileged = $conf->{unprivileged
};
648 my $pid = PVE
::LXC
::find_lxc_pid
($vmid);
649 # We open the file then enter the container's mount - and for
650 # unprivileged containers - user namespace and then create the
651 # file. This avoids symlink attacks as a symlink cannot point
652 # outside the namespace and our own access is equivalent to the
653 # container-local's root user. Also the user-passed -user and
654 # -group parameters will use the container-local's user and
656 sysopen my $srcfd, $file, O_RDONLY
657 or die "failed to open $file for reading\n";
659 sysopen my $mntnsfd, "/proc/$pid/ns/mnt", O_RDONLY
660 or die "failed to open the container's mount namespace\n";
663 sysopen $usernsfd, "/proc/$pid/ns/user", O_RDONLY
664 or die "failed to open the container's user namespace\n";
667 PVE
::Tools
::setns
(fileno($mntnsfd), PVE
::Tools
::CLONE_NEWNS
)
668 or die "failed to enter the container's mount namespace\n";
670 chdir('/') or die "failed to change to container root directory\n";
673 PVE
::Tools
::setns
(fileno($usernsfd), PVE
::Tools
::CLONE_NEWUSER
)
674 or die "failed to enter the container's user namespace\n";
676 POSIX
::setgid
(0) or die "setgid failed: $!\n";
677 POSIX
::setuid
(0) or die "setuid failed: $!\n";
680 my $destfd = create_file
($dest, $perms, $user, $group);
681 copy
($srcfd, $destfd);
684 # This avoids having to setns() back to our namespace.
685 return $rpcenv->fork_worker('push_file', $vmid, undef, $realcmd);
688 return PVE
::LXC
::Config-
>lock_config($vmid, $code);
691 __PACKAGE__-
>register_method ({
695 description
=> "Print the list of assigned CPU sets.",
697 additionalProperties
=> 0,
700 returns
=> { type
=> 'null'},
704 my $cgv1 = PVE
::LXC
::get_cgroup_subsystems
();
705 if (!$cgv1->{cpuset
}) {
706 print "cpuset cgroup not available\n";
710 my $ctlist = PVE
::LXC
::config_list
();
716 foreach my $vmid (sort keys %$ctlist) {
717 next if ! -d
"/sys/fs/cgroup/cpuset/lxc/$vmid";
719 my $cpuset = eval { PVE
::CpuSet-
>new_from_cgroup("lxc/$vmid"); };
724 my @cpuset_members = $cpuset->members();
728 my $last = $cpuset_members[-1];
730 for (my $id = 0; $id <= $last; $id++) {
731 my $empty = ' ' x
length("$id");
732 $line .= ' ' . ($cpuset->has($id) ?
$id : $empty);
734 $len = length($line) if length($line) > $len;
735 $id_len = length($vmid) if length($vmid) > $id_len;
737 $res->{$vmid} = $line;
740 my @vmlist = sort keys %$res;
742 if (scalar(@vmlist)) {
743 my $header = '-' x
($len + $id_len) . "\n";
746 foreach my $vmid (@vmlist) {
747 print sprintf("%${id_len}i%s\n", $vmid, $res->{$vmid});
752 print "no running containers\n";
758 __PACKAGE__-
>register_method ({
762 description
=> "Run fstrim on a chosen CT and its mountpoints.",
764 additionalProperties
=> 0,
766 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
769 returns
=> { type
=> 'null' },
773 my $vmid = $param->{'vmid'};
775 my $rootdir = "/var/lib/lxc/$vmid/rootfs";
777 my $storecfg = PVE
::Storage
::config
();
778 my $conf = PVE
::LXC
::Config-
>set_lock($vmid, 'fstrim');
779 PVE
::LXC
::mount_all
($vmid, $storecfg, $conf);
782 PVE
::LXC
::Config-
>foreach_mountpoint($conf, sub {
783 my ($name, $mp) = @_;
785 my $cmd = ["fstrim", "-v", "$rootdir$path"];
786 PVE
::Tools
::run_command
($cmd);
790 PVE
::LXC
::umount_all
($vmid, $storecfg, $conf, 0);
791 PVE
::LXC
::Config-
>remove_lock($vmid, 'fstrim');
797 list
=> [ 'PVE::API2::LXC', 'vmlist', [], { node
=> $nodename }, sub {
799 return if !scalar(@$res);
800 my $format = "%-10s %-10s %-12s %-20s\n";
801 printf($format, 'VMID', 'Status', 'Lock', 'Name');
802 foreach my $d (sort {$a->{vmid
} <=> $b->{vmid
} } @$res) {
803 printf($format, $d->{vmid
}, $d->{status
}, $d->{lock}, $d->{name
});
806 config
=> [ "PVE::API2::LXC::Config", 'vm_config', ['vmid'],
807 { node
=> $nodename }, sub {
809 foreach my $k (sort (keys %$config)) {
810 next if $k eq 'digest';
812 my $v = $config->{$k};
813 if ($k eq 'description') {
814 $v = PVE
::Tools
::encode_text
($v);
818 if (defined($config->{'lxc'})) {
819 my $lxc_list = $config->{'lxc'};
820 foreach my $lxc_opt (@$lxc_list) {
821 print "$lxc_opt->[0]: $lxc_opt->[1]\n"
825 set
=> [ 'PVE::API2::LXC::Config', 'update_vm', ['vmid'], { node
=> $nodename }],
827 resize
=> [ "PVE::API2::LXC", 'resize_vm', ['vmid', 'disk', 'size'], { node
=> $nodename } ],
829 create
=> [ 'PVE::API2::LXC', 'create_vm', ['vmid', 'ostemplate'], { node
=> $nodename }, $upid_exit ],
830 restore
=> [ 'PVE::API2::LXC', 'create_vm', ['vmid', 'ostemplate'], { node
=> $nodename, restore
=> 1 }, $upid_exit ],
832 start
=> [ 'PVE::API2::LXC::Status', 'vm_start', ['vmid'], { node
=> $nodename }, $upid_exit],
833 suspend
=> [ 'PVE::API2::LXC::Status', 'vm_suspend', ['vmid'], { node
=> $nodename }, $upid_exit],
834 resume
=> [ 'PVE::API2::LXC::Status', 'vm_resume', ['vmid'], { node
=> $nodename }, $upid_exit],
835 shutdown => [ 'PVE::API2::LXC::Status', 'vm_shutdown', ['vmid'], { node
=> $nodename }, $upid_exit],
836 stop
=> [ 'PVE::API2::LXC::Status', 'vm_stop', ['vmid'], { node
=> $nodename }, $upid_exit],
838 clone
=> [ "PVE::API2::LXC", 'clone_vm', ['vmid', 'newid'], { node
=> $nodename }, $upid_exit ],
839 migrate
=> [ "PVE::API2::LXC", 'migrate_vm', ['vmid', 'target'], { node
=> $nodename }, $upid_exit],
840 move_volume
=> [ "PVE::API2::LXC", 'move_volume', ['vmid', 'volume', 'storage'], { node
=> $nodename }, $upid_exit ],
842 status
=> [ __PACKAGE__
, 'status', ['vmid']],
843 console
=> [ __PACKAGE__
, 'console', ['vmid']],
844 enter
=> [ __PACKAGE__
, 'enter', ['vmid']],
845 unlock
=> [ __PACKAGE__
, 'unlock', ['vmid']],
846 exec => [ __PACKAGE__
, 'exec', ['vmid', 'extra-args']],
847 fsck
=> [ __PACKAGE__
, 'fsck', ['vmid']],
849 mount
=> [ __PACKAGE__
, 'mount', ['vmid']],
850 unmount
=> [ __PACKAGE__
, 'unmount', ['vmid']],
851 push => [ __PACKAGE__
, 'push', ['vmid', 'file', 'destination']],
852 pull
=> [ __PACKAGE__
, 'pull', ['vmid', 'path', 'destination']],
854 df
=> [ __PACKAGE__
, 'df', ['vmid']],
855 rescan
=> [ __PACKAGE__
, 'rescan', []],
857 destroy
=> [ 'PVE::API2::LXC', 'destroy_vm', ['vmid'],
858 { node
=> $nodename }, $upid_exit ],
860 snapshot
=> [ "PVE::API2::LXC::Snapshot", 'snapshot', ['vmid', 'snapname'],
861 { node
=> $nodename } , $upid_exit ],
863 delsnapshot
=> [ "PVE::API2::LXC::Snapshot", 'delsnapshot', ['vmid', 'snapname'], { node
=> $nodename } , $upid_exit ],
865 listsnapshot
=> [ "PVE::API2::LXC::Snapshot", 'list', ['vmid'], { node
=> $nodename },
868 foreach my $e (@$res) {
869 my $headline = $e->{description
} || 'no-description';
870 $headline =~ s/\n.*//sg;
871 my $parent = $e->{parent
} // 'no-parent';
872 printf("%-20s %-20s %s\n", $e->{name
}, $parent, $headline);
876 rollback
=> [ "PVE::API2::LXC::Snapshot", 'rollback', ['vmid', 'snapname'], { node
=> $nodename } , $upid_exit ],
878 template
=> [ "PVE::API2::LXC", 'template', ['vmid'], { node
=> $nodename }],
880 cpusets
=> [ __PACKAGE__
, 'cpusets', []],
882 fstrim
=> [ __PACKAGE__
, 'fstrim', ['vmid']],