]>
git.proxmox.com Git - pve-container.git/blob - src/PVE/CLI/pct.pm
10 use PVE
::GuestHelpers
;
12 use PVE
::Tools
qw(extract_param);
16 use PVE
::RPCEnvironment
;
17 use PVE
::JSONSchema
qw(get_standard_option);
20 use PVE
::API2
::LXC
::Config
;
21 use PVE
::API2
::LXC
::Status
;
22 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 PVE
::LXC
::Config-
>load_config($vmid); # test if container exists on this node
162 die "container '$vmid' not running!\n" if !PVE
::LXC
::check_running
($vmid);
164 exec('lxc-attach', '-n', $vmid);
167 __PACKAGE__-
>register_method ({
171 description
=> "Launch a command inside the specified container.",
173 additionalProperties
=> 0,
175 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid_running
}),
176 'extra-args' => get_standard_option
('extra-args'),
179 returns
=> { type
=> 'null' },
183 my $vmid = $param->{vmid
};
184 PVE
::LXC
::Config-
>load_config($vmid); # test if container exists on this node
185 die "container '$vmid' not running!\n" if !PVE
::LXC
::check_running
($vmid);
187 die "missing command" if !@{$param->{'extra-args'}};
189 exec('lxc-attach', '-n', $vmid, '--', @{$param->{'extra-args'}});
192 __PACKAGE__-
>register_method ({
196 description
=> "Run a filesystem check (fsck) on a container volume.",
198 additionalProperties
=> 0,
200 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid_stopped
}),
204 description
=> "Force checking, even if the filesystem seems clean",
210 description
=> "A volume on which to run the filesystem check",
211 enum
=> [PVE
::LXC
::Config-
>valid_volume_keys()],
215 returns
=> { type
=> 'null' },
219 my $vmid = $param->{'vmid'};
220 my $device = defined($param->{'device'}) ?
$param->{'device'} : 'rootfs';
222 my $command = ['fsck', '-a', '-l'];
223 push(@$command, '-f') if $param->{force
};
225 # critical path: all of this will be done while the container is locked
228 my $conf = PVE
::LXC
::Config-
>load_config($vmid);
229 my $storage_cfg = PVE
::Storage
::config
();
231 defined($conf->{$device}) || die "cannot run command on non-existing mount point $device\n";
233 my $mount_point = PVE
::LXC
::Config-
>parse_volume($device, $conf->{$device});
235 die "cannot run fsck when container is running\n"
236 if PVE
::LXC
::check_running
($vmid);
238 my $volid = $mount_point->{volume
};
241 my $storage_id = PVE
::Storage
::parse_volume_id
($volid, 1);
244 my (undef, undef, undef, undef, undef, undef, $format) =
245 PVE
::Storage
::parse_volname
($storage_cfg, $volid);
247 die "unable to run fsck for '$volid' (format == $format)\n"
250 $path = PVE
::Storage
::map_volume
($storage_cfg, $volid);
253 if (($volid =~ m
|^/.+|) && (-b
$volid)) {
254 # pass block devices directly
257 die "path '$volid' does not point to a block device\n";
261 push(@$command, $path);
262 PVE
::Tools
::run_command
($command);
264 PVE
::Storage
::unmap_volume
($storage_cfg, $volid) if $storage_id;
267 PVE
::LXC
::Config-
>lock_config($vmid, $do_fsck);
271 __PACKAGE__-
>register_method({
275 description
=> "Mount the container's filesystem on the host. " .
276 "This will hold a lock on the container and is meant for emergency maintenance only " .
277 "as it will prevent further operations on the container other than start and stop.",
279 additionalProperties
=> 0,
281 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
284 returns
=> { type
=> 'null' },
288 my $rpcenv = PVE
::RPCEnvironment
::get
();
290 my $vmid = extract_param
($param, 'vmid');
291 my $storecfg = PVE
::Storage
::config
();
292 PVE
::LXC
::Config-
>lock_config($vmid, sub {
293 my $conf = PVE
::LXC
::Config-
>set_lock($vmid, 'mounted');
294 PVE
::LXC
::mount_all
($vmid, $storecfg, $conf);
297 print "mounted CT $vmid in '/var/lib/lxc/$vmid/rootfs'\n";
301 __PACKAGE__-
>register_method({
305 description
=> "Unmount the container's filesystem.",
307 additionalProperties
=> 0,
309 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
312 returns
=> { type
=> 'null' },
316 my $rpcenv = PVE
::RPCEnvironment
::get
();
318 my $vmid = extract_param
($param, 'vmid');
319 my $storecfg = PVE
::Storage
::config
();
320 PVE
::LXC
::Config-
>lock_config($vmid, sub {
321 my $conf = PVE
::LXC
::Config-
>load_config($vmid);
322 PVE
::LXC
::umount_all
($vmid, $storecfg, $conf, 0);
323 PVE
::LXC
::Config-
>remove_lock($vmid, 'mounted');
328 __PACKAGE__-
>register_method({
332 description
=> "Get the container's current disk usage.",
334 additionalProperties
=> 0,
336 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
339 returns
=> { type
=> 'null' },
343 my $rpcenv = PVE
::RPCEnvironment
::get
();
345 # JSONSchema's format_size is exact, this uses floating point numbers
348 return $size if $size < 1024.;
350 return sprintf('%.1fK', ${size
}) if $size < 1024.;
352 return sprintf('%.1fM', ${size
}) if $size < 1024.;
354 return sprintf('%.1fG', ${size
}) if $size < 1024.;
356 return sprintf('%.1fT', ${size
}) if $size < 1024.;
359 my $vmid = extract_param
($param, 'vmid');
360 PVE
::LXC
::Config-
>lock_config($vmid, sub {
361 my $pid = eval { PVE
::LXC
::find_lxc_pid
($vmid) };
362 my ($conf, $rootdir, $storecfg, $mounted);
364 $conf = PVE
::LXC
::Config-
>set_lock($vmid, 'mounted');
365 $rootdir = "/var/lib/lxc/$vmid/rootfs";
366 $storecfg = PVE
::Storage
::config
();
367 PVE
::LXC
::mount_all
($vmid, $storecfg, $conf);
370 $conf = PVE
::LXC
::Config-
>load_config($vmid);
371 $rootdir = "/proc/$pid/root";
374 my @list = [qw(MP Volume Size Used Avail Use% Path)];
375 my @len = map { length($_) } @{$list[0]};
378 PVE
::LXC
::Config-
>foreach_volume($conf, sub {
379 my ($name, $mp) = @_;
380 my $path = $mp->{mp
};
382 my $df = PVE
::Tools
::df
("$rootdir/$path", 3);
383 my $total = $format->($df->{total
});
384 my $used = $format->($df->{used
});
385 my $avail = $format->($df->{avail
});
387 my $pc = sprintf('%.1f', $df->{used
}/$df->{total
});
389 my $entry = [ $name, $mp->{volume
}, $total, $used, $avail, $pc, $path ];
392 foreach my $i (0..5) {
393 $len[$i] = length($entry->[$i])
394 if $len[$i] < length($entry->[$i]);
398 my $format = "%-$len[0]s %-$len[1]s %$len[2]s %$len[3]s %$len[4]s %$len[5]s %s\n";
399 printf($format, @$_) foreach @list;
404 PVE
::LXC
::umount_all
($vmid, $storecfg, $conf, 0);
405 PVE
::LXC
::Config-
>remove_lock($vmid, 'mounted');
411 # File creation with specified ownership and permissions.
412 # User and group can be names or decimal numbers.
413 # Permissions are explicit (not affected by umask) and can be numeric with the
414 # usual 0/0x prefixes for octal/hex.
416 my ($path, $perms, $user, $group) = @_;
418 if (defined($user)) {
419 if ($user =~ /^\d+$/) {
422 $uid = getpwnam($user);
423 die "failed to get uid for: $user\n" if !defined($uid);
426 if (defined($group)) {
427 if ($group =~ /^\d+$/) {
430 $gid = getgrnam($group);
431 die "failed to get gid for: $group\n" if !defined($gid);
435 if (defined($perms)) {
437 my ($mode, $unparsed) = POSIX
::strtoul
($perms, 0);
438 die "invalid mode: '$perms'\n" if $perms eq '' || $unparsed > 0 || $!;
443 if (sysopen($fd, $path, O_WRONLY
| O_CREAT
| O_EXCL
, 0)) {
444 $perms = 0666 & ~umask if !defined($perms);
446 # If the path previously existed then we do not care about left-over
447 # file descriptors even if the permissions/ownership is changed.
448 sysopen($fd, $path, O_WRONLY
| O_CREAT
| O_TRUNC
)
449 or die "failed to create file: $path: $!\n";
454 if (defined($perms)) {
459 if (defined($uid) || defined($gid)) {
461 my ($fuid, $fgid) = (stat($fd))[4,5] if !defined($uid) || !defined($gid);
462 $uid = $fuid if !defined($uid);
463 $gid = $fgid if !defined($gid);
464 chown($uid, $gid, $fd)
465 or die "failed to change file owner: $!\n";
470 __PACKAGE__-
>register_method ({
474 description
=> "Rescan all storages and update disk sizes and unused disk images.",
476 additionalProperties
=> 0,
478 vmid
=> get_standard_option
('pve-vmid', {
480 completion
=> \
&PVE
::LXC
::complete_ctid
,
486 description
=> 'Do not actually write changes out to conifg.',
490 returns
=> { type
=> 'null'},
494 my $dryrun = $param->{dryrun
};
496 print "NOTE: running in dry-run mode, won't write changes out!\n" if $dryrun;
498 PVE
::LXC
::rescan
($param->{vmid
}, 0, $dryrun);
503 __PACKAGE__-
>register_method({
507 description
=> "Copy a file from the container to the local system.",
509 additionalProperties
=> 0,
511 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
514 description
=> "Path to a file inside the container to pull.",
518 description
=> "Destination",
522 description
=> 'Owner user name or id.',
527 description
=> 'Owner group name or id.',
532 description
=> "File permissions to use (octal by default, prefix with '0x' for hexadecimal).",
539 description
=> "the task ID.",
544 my $rpcenv = PVE
::RPCEnvironment
::get
();
546 my $vmid = extract_param
($param, 'vmid');
547 my $path = extract_param
($param, 'path');
548 my $dest = extract_param
($param, 'destination');
550 my $perms = extract_param
($param, 'perms');
551 # assume octal as default
552 $perms = "0$perms" if defined($perms) && $perms !~m/^0/;
553 my $user = extract_param
($param, 'user');
554 my $group = extract_param
($param, 'group');
557 my $running = PVE
::LXC
::check_running
($vmid);
558 die "can only pull files from a running VM" if !$running;
561 my $pid = PVE
::LXC
::find_lxc_pid
($vmid);
562 # Avoid symlink issues by opening the files from inside the
563 # corresponding namespaces.
564 my $destfd = create_file
($dest, $perms, $user, $group);
566 sysopen my $mntnsfd, "/proc/$pid/ns/mnt", O_RDONLY
567 or die "failed to open the container's mount namespace\n";
568 PVE
::Tools
::setns
(fileno($mntnsfd), PVE
::Tools
::CLONE_NEWNS
)
569 or die "failed to enter the container's mount namespace\n";
571 chdir('/') or die "failed to change to container root directory\n";
573 open my $srcfd, '<', $path
574 or die "failed to open $path: $!\n";
576 copy
($srcfd, $destfd);
579 # This avoids having to setns() back to our namespace.
580 return $rpcenv->fork_worker('pull_file', $vmid, undef, $realcmd);
583 return PVE
::LXC
::Config-
>lock_config($vmid, $code);
586 __PACKAGE__-
>register_method({
590 description
=> "Copy a local file to the container.",
592 additionalProperties
=> 0,
594 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
597 description
=> "Path to a local file.",
601 description
=> "Destination inside the container to write to.",
605 description
=> 'Owner user name or id. When using a name it must exist inside the container.',
610 description
=> 'Owner group name or id. When using a name it must exist inside the container.',
615 description
=> "File permissions to use (octal by default, prefix with '0x' for hexadecimal).",
622 description
=> "the task ID.",
627 my $rpcenv = PVE
::RPCEnvironment
::get
();
629 my $vmid = extract_param
($param, 'vmid');
630 my $file = extract_param
($param, 'file');
631 my $dest = extract_param
($param, 'destination');
633 my $perms = extract_param
($param, 'perms');
634 # assume octal as default
635 $perms = "0$perms" if defined($perms) && $perms !~m/^0/;
636 my $user = extract_param
($param, 'user');
637 my $group = extract_param
($param, 'group');
640 my $running = PVE
::LXC
::check_running
($vmid);
641 die "can only push files to a running CT\n" if !$running;
643 my $conf = PVE
::LXC
::Config-
>load_config($vmid);
644 my $unprivileged = $conf->{unprivileged
};
647 my $pid = PVE
::LXC
::find_lxc_pid
($vmid);
648 # We open the file then enter the container's mount - and for
649 # unprivileged containers - user namespace and then create the
650 # file. This avoids symlink attacks as a symlink cannot point
651 # outside the namespace and our own access is equivalent to the
652 # container-local's root user. Also the user-passed -user and
653 # -group parameters will use the container-local's user and
655 sysopen my $srcfd, $file, O_RDONLY
656 or die "failed to open $file for reading\n";
658 sysopen my $mntnsfd, "/proc/$pid/ns/mnt", O_RDONLY
659 or die "failed to open the container's mount namespace\n";
662 sysopen $usernsfd, "/proc/$pid/ns/user", O_RDONLY
663 or die "failed to open the container's user namespace\n";
666 PVE
::Tools
::setns
(fileno($mntnsfd), PVE
::Tools
::CLONE_NEWNS
)
667 or die "failed to enter the container's mount namespace\n";
669 chdir('/') or die "failed to change to container root directory\n";
672 PVE
::Tools
::setns
(fileno($usernsfd), PVE
::Tools
::CLONE_NEWUSER
)
673 or die "failed to enter the container's user namespace\n";
675 POSIX
::setgid
(0) or die "setgid failed: $!\n";
676 POSIX
::setuid
(0) or die "setuid failed: $!\n";
679 my $destfd = create_file
($dest, $perms, $user, $group);
680 copy
($srcfd, $destfd);
683 # This avoids having to setns() back to our namespace.
684 return $rpcenv->fork_worker('push_file', $vmid, undef, $realcmd);
687 return PVE
::LXC
::Config-
>lock_config($vmid, $code);
690 __PACKAGE__-
>register_method ({
694 description
=> "Print the list of assigned CPU sets.",
696 additionalProperties
=> 0,
699 returns
=> { type
=> 'null'},
703 my $ctlist = PVE
::LXC
::config_list
();
709 foreach my $vmid (sort keys %$ctlist) {
710 my $cgroup = PVE
::LXC
::CGroup-
>new($vmid);
713 if (defined($path = $cgroup->get_path('cpuset'))) {
714 $cpuset = eval { PVE
::CpuSet-
>new_from_path($path); };
715 } elsif (defined($path = $cgroup->get_path())) {
716 $cpuset = eval { PVE
::CpuSet-
>new_from_path($path); };
718 # Container not running.
726 my @cpuset_members = $cpuset->members();
730 my $last = $cpuset_members[-1];
732 for (my $id = 0; $id <= $last; $id++) {
733 my $empty = ' ' x
length("$id");
734 $line .= ' ' . ($cpuset->has($id) ?
$id : $empty);
736 $len = length($line) if length($line) > $len;
737 $id_len = length($vmid) if length($vmid) > $id_len;
739 $res->{$vmid} = $line;
742 my @vmlist = sort keys %$res;
744 if (scalar(@vmlist)) {
745 my $header = '-' x
($len + $id_len) . "\n";
748 foreach my $vmid (@vmlist) {
749 print sprintf("%${id_len}i%s\n", $vmid, $res->{$vmid});
754 print "no running containers\n";
760 __PACKAGE__-
>register_method ({
764 description
=> "Run fstrim on a chosen CT and its mountpoints.",
766 additionalProperties
=> 0,
768 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
769 'ignore-mountpoints' => {
770 description
=> 'Skip all mountpoints, only do fstrim on the container root.',
776 returns
=> { type
=> 'null' },
780 my $vmid = $param->{'vmid'};
782 my $rootdir = "/var/lib/lxc/$vmid/rootfs";
784 my $storecfg = PVE
::Storage
::config
();
785 my $conf = PVE
::LXC
::Config-
>set_lock($vmid, 'fstrim');
788 PVE
::LXC
::mount_all
($vmid, $storecfg, $conf);
789 PVE
::LXC
::Config-
>foreach_volume($conf, sub {
790 my ($name, $mp) = @_;
792 return if $param->{'ignore-mountpoints'} && $name =~ /^mp\d+/;
793 my $cmd = ["fstrim", "-v", "$rootdir$path"];
794 PVE
::Tools
::run_command
($cmd);
799 PVE
::LXC
::umount_all
($vmid, $storecfg, $conf, 0);
800 PVE
::LXC
::Config-
>remove_lock($vmid, 'fstrim');
806 list
=> [ 'PVE::API2::LXC', 'vmlist', [], { node
=> $nodename }, sub {
808 return if !scalar(@$res);
809 my $format = "%-10s %-10s %-12s %-20s\n";
810 printf($format, 'VMID', 'Status', 'Lock', 'Name');
811 foreach my $d (sort {$a->{vmid
} <=> $b->{vmid
} } @$res) {
812 my $lock = $d->{lock} || '';
813 printf($format, $d->{vmid
}, $d->{status
}, $lock, $d->{name
});
816 config
=> [ "PVE::API2::LXC::Config", 'vm_config', ['vmid'], { node
=> $nodename }, sub {
818 for my $k (sort (keys %$config)) {
819 next if $k eq 'digest' || $k eq 'lxc';
820 my $v = $config->{$k};
821 if ($k eq 'description') {
822 $v = PVE
::Tools
::encode_text
($v);
826 if (defined(my $lxc_list = $config->{'lxc'})) {
827 for my $lxc_opt (@$lxc_list) {
828 print "$lxc_opt->[0]: $lxc_opt->[1]\n"
833 pending
=> [ "PVE::API2::LXC", "vm_pending", ['vmid'], { node
=> $nodename }, \
&PVE
::GuestHelpers
::format_pending
],
834 set
=> [ 'PVE::API2::LXC::Config', 'update_vm', ['vmid'], { node
=> $nodename }],
836 resize
=> [ "PVE::API2::LXC", 'resize_vm', ['vmid', 'disk', 'size'], { node
=> $nodename } ],
838 create
=> [ 'PVE::API2::LXC', 'create_vm', ['vmid', 'ostemplate'], { node
=> $nodename }, $upid_exit ],
839 restore
=> [ 'PVE::API2::LXC', 'create_vm', ['vmid', 'ostemplate'], { node
=> $nodename, restore
=> 1 }, $upid_exit ],
840 destroy
=> [ 'PVE::API2::LXC', 'destroy_vm', ['vmid'], { node
=> $nodename }, $upid_exit ],
842 start
=> [ 'PVE::API2::LXC::Status', 'vm_start', ['vmid'], { node
=> $nodename }, $upid_exit],
843 suspend
=> [ 'PVE::API2::LXC::Status', 'vm_suspend', ['vmid'], { node
=> $nodename }, $upid_exit],
844 resume
=> [ 'PVE::API2::LXC::Status', 'vm_resume', ['vmid'], { node
=> $nodename }, $upid_exit],
845 shutdown => [ 'PVE::API2::LXC::Status', 'vm_shutdown', ['vmid'], { node
=> $nodename }, $upid_exit],
846 stop
=> [ 'PVE::API2::LXC::Status', 'vm_stop', ['vmid'], { node
=> $nodename }, $upid_exit],
847 reboot
=> [ 'PVE::API2::LXC::Status', 'vm_reboot', ['vmid'], { node
=> $nodename }, $upid_exit],
849 clone
=> [ "PVE::API2::LXC", 'clone_vm', ['vmid', 'newid'], { node
=> $nodename }, $upid_exit ],
850 migrate
=> [ "PVE::API2::LXC", 'migrate_vm', ['vmid', 'target'], { node
=> $nodename }, $upid_exit],
851 move_volume
=> [ "PVE::API2::LXC", 'move_volume', ['vmid', 'volume', 'storage'], { node
=> $nodename }, $upid_exit ],
853 snapshot
=> [ "PVE::API2::LXC::Snapshot", 'snapshot', ['vmid', 'snapname'], { node
=> $nodename } , $upid_exit ],
854 delsnapshot
=> [ "PVE::API2::LXC::Snapshot", 'delsnapshot', ['vmid', 'snapname'], { node
=> $nodename } , $upid_exit ],
855 listsnapshot
=> [ "PVE::API2::LXC::Snapshot", 'list', ['vmid'], { node
=> $nodename }, \
&PVE
::GuestHelpers
::print_snapshot_tree
],
856 rollback
=> [ "PVE::API2::LXC::Snapshot", 'rollback', ['vmid', 'snapname'], { node
=> $nodename } , $upid_exit ],
857 template
=> [ "PVE::API2::LXC", 'template', ['vmid'], { node
=> $nodename }],
859 status
=> [ __PACKAGE__
, 'status', ['vmid']],
860 console
=> [ __PACKAGE__
, 'console', ['vmid']],
861 enter
=> [ __PACKAGE__
, 'enter', ['vmid']],
862 unlock
=> [ __PACKAGE__
, 'unlock', ['vmid']],
863 exec => [ __PACKAGE__
, 'exec', ['vmid', 'extra-args']],
864 fsck
=> [ __PACKAGE__
, 'fsck', ['vmid']],
866 mount
=> [ __PACKAGE__
, 'mount', ['vmid']],
867 unmount
=> [ __PACKAGE__
, 'unmount', ['vmid']],
868 push => [ __PACKAGE__
, 'push', ['vmid', 'file', 'destination']],
869 pull
=> [ __PACKAGE__
, 'pull', ['vmid', 'path', 'destination']],
871 df
=> [ __PACKAGE__
, 'df', ['vmid']],
872 rescan
=> [ __PACKAGE__
, 'rescan', []],
873 cpusets
=> [ __PACKAGE__
, 'cpusets', []],
874 fstrim
=> [ __PACKAGE__
, 'fstrim', ['vmid']],