]>
git.proxmox.com Git - pve-container.git/blob - src/PVE/CLI/pct.pm
462917bdbd83b7f40779dd80cd2bb87b1d80b0c7
13 use PVE
::GuestHelpers
;
15 use PVE
::JSONSchema
qw(get_standard_option);
17 use PVE
::RPCEnvironment
;
19 use PVE
::Tools
qw(extract_param);
21 use PVE
::API2
::LXC
::Config
;
22 use PVE
::API2
::LXC
::Snapshot
;
23 use PVE
::API2
::LXC
::Status
;
26 use base
qw(PVE::CLIHandler);
28 my $nodename = PVE
::INotify
::nodename
();
32 my $status = PVE
::Tools
::upid_read_status
($upid);
33 exit(PVE
::Tools
::upid_status_is_error
($status) ?
-1 : 0);
36 sub setup_environment
{
37 PVE
::RPCEnvironment-
>setup_default_cli_env();
40 __PACKAGE__-
>register_method ({
44 description
=> "Show CT status.",
46 additionalProperties
=> 0,
48 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
50 description
=> "Verbose output format",
56 returns
=> { type
=> 'null'},
61 my $conf = PVE
::LXC
::Config-
>load_config ($param->{vmid
});
63 my $vmstatus = PVE
::LXC
::vmstatus
($param->{vmid
});
64 my $stat = $vmstatus->{$param->{vmid
}};
65 if ($param->{verbose
}) {
66 foreach my $k (sort (keys %$stat)) {
72 my $status = $stat->{status
} || 'unknown';
73 print "status: $status\n";
84 PVE
::CLIHandler
::get_standard_mapping
('pve-password'),
89 return $mapping->{$name};
92 __PACKAGE__-
>register_method ({
96 description
=> "Unlock the VM.",
98 additionalProperties
=> 0,
100 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
103 returns
=> { type
=> 'null'},
107 my $vmid = $param->{vmid
};
109 PVE
::LXC
::Config-
>remove_lock($vmid);
114 __PACKAGE__-
>register_method ({
118 description
=> "Launch a console for the specified container.",
120 additionalProperties
=> 0,
122 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid_running
}),
124 description
=> "Escape sequence prefix. For example to use <Ctrl+b q> as the escape sequence pass '^b'.",
127 pattern
=> '\^?[a-z]',
132 returns
=> { type
=> 'null' },
137 # test if container exists on this node
138 my $conf = PVE
::LXC
::Config-
>load_config($param->{vmid
});
140 my $cmd = PVE
::LXC
::get_console_command
($param->{vmid
}, $conf, $param->{escape
});
144 __PACKAGE__-
>register_method ({
148 description
=> "Launch a shell for the specified container.",
150 additionalProperties
=> 0,
152 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid_running
}),
155 returns
=> { type
=> 'null' },
160 my $vmid = $param->{vmid
};
162 PVE
::LXC
::Config-
>load_config($vmid); # test if container exists on this node
163 die "container '$vmid' not running!\n" if !PVE
::LXC
::check_running
($vmid);
165 exec('lxc-attach', '-n', $vmid);
168 __PACKAGE__-
>register_method ({
172 description
=> "Launch a command inside the specified container.",
174 additionalProperties
=> 0,
176 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid_running
}),
177 'extra-args' => get_standard_option
('extra-args'),
180 returns
=> { type
=> 'null' },
184 my $vmid = $param->{vmid
};
185 PVE
::LXC
::Config-
>load_config($vmid); # test if container exists on this node
186 die "container '$vmid' not running!\n" if !PVE
::LXC
::check_running
($vmid);
188 die "missing command" if !@{$param->{'extra-args'}};
190 exec('lxc-attach', '-n', $vmid, '--', @{$param->{'extra-args'}});
193 __PACKAGE__-
>register_method ({
197 description
=> "Run a filesystem check (fsck) on a container volume.",
199 additionalProperties
=> 0,
201 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid_stopped
}),
205 description
=> "Force checking, even if the filesystem seems clean",
211 description
=> "A volume on which to run the filesystem check",
212 enum
=> [PVE
::LXC
::Config-
>valid_volume_keys()],
216 returns
=> { type
=> 'null' },
220 my $vmid = $param->{'vmid'};
221 my $device = defined($param->{'device'}) ?
$param->{'device'} : 'rootfs';
223 my $command = ['fsck', '-a', '-l'];
224 push(@$command, '-f') if $param->{force
};
226 # critical path: all of this will be done while the container is locked
229 my $conf = PVE
::LXC
::Config-
>load_config($vmid);
230 my $storage_cfg = PVE
::Storage
::config
();
232 defined($conf->{$device}) || die "cannot run command on non-existing mount point $device\n";
234 my $mount_point = PVE
::LXC
::Config-
>parse_volume($device, $conf->{$device});
236 die "cannot run fsck when container is running\n"
237 if PVE
::LXC
::check_running
($vmid);
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
::map_volume
($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);
263 PVE
::Tools
::run_command
($command);
265 PVE
::Storage
::unmap_volume
($storage_cfg, $volid) if $storage_id;
268 PVE
::LXC
::Config-
>lock_config($vmid, $do_fsck);
272 __PACKAGE__-
>register_method({
276 description
=> "Mount the container's filesystem on the host. " .
277 "This will hold a lock on the container and is meant for emergency maintenance only " .
278 "as it will prevent further operations on the container other than start and stop.",
280 additionalProperties
=> 0,
282 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
285 returns
=> { type
=> 'null' },
289 my $rpcenv = PVE
::RPCEnvironment
::get
();
291 my $vmid = extract_param
($param, 'vmid');
292 my $storecfg = PVE
::Storage
::config
();
293 PVE
::LXC
::Config-
>lock_config($vmid, sub {
294 my $conf = PVE
::LXC
::Config-
>set_lock($vmid, 'mounted');
295 PVE
::LXC
::mount_all
($vmid, $storecfg, $conf);
298 print "mounted CT $vmid in '/var/lib/lxc/$vmid/rootfs'\n";
302 __PACKAGE__-
>register_method({
306 description
=> "Unmount the container's filesystem.",
308 additionalProperties
=> 0,
310 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
313 returns
=> { type
=> 'null' },
317 my $rpcenv = PVE
::RPCEnvironment
::get
();
319 my $vmid = extract_param
($param, 'vmid');
320 my $storecfg = PVE
::Storage
::config
();
321 PVE
::LXC
::Config-
>lock_config($vmid, sub {
322 my $conf = PVE
::LXC
::Config-
>load_config($vmid);
323 PVE
::LXC
::umount_all
($vmid, $storecfg, $conf, 0);
324 PVE
::LXC
::Config-
>remove_lock($vmid, 'mounted');
329 __PACKAGE__-
>register_method({
333 description
=> "Get the container's current disk usage.",
335 additionalProperties
=> 0,
337 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
340 returns
=> { type
=> 'null' },
344 my $rpcenv = PVE
::RPCEnvironment
::get
();
346 # JSONSchema's format_size is exact, this uses floating point numbers
349 return $size if $size < 1024.;
351 return sprintf('%.1fK', ${size
}) if $size < 1024.;
353 return sprintf('%.1fM', ${size
}) if $size < 1024.;
355 return sprintf('%.1fG', ${size
}) if $size < 1024.;
357 return sprintf('%.1fT', ${size
}) if $size < 1024.;
360 my $vmid = extract_param
($param, 'vmid');
361 PVE
::LXC
::Config-
>lock_config($vmid, sub {
362 my $pid = eval { PVE
::LXC
::find_lxc_pid
($vmid) };
363 my ($conf, $rootdir, $storecfg, $mounted);
365 $conf = PVE
::LXC
::Config-
>set_lock($vmid, 'mounted');
366 $rootdir = "/var/lib/lxc/$vmid/rootfs";
367 $storecfg = PVE
::Storage
::config
();
368 PVE
::LXC
::mount_all
($vmid, $storecfg, $conf);
371 $conf = PVE
::LXC
::Config-
>load_config($vmid);
372 $rootdir = "/proc/$pid/root";
375 my @list = [qw(MP Volume Size Used Avail Use% Path)];
376 my @len = map { length($_) } @{$list[0]};
379 PVE
::LXC
::Config-
>foreach_volume($conf, sub {
380 my ($name, $mp) = @_;
381 my $path = $mp->{mp
};
383 my $df = PVE
::Tools
::df
("$rootdir/$path", 3);
384 my $total = $format->($df->{total
});
385 my $used = $format->($df->{used
});
386 my $avail = $format->($df->{avail
});
388 my $pc = sprintf('%.1f', $df->{used
}/$df->{total
});
390 my $entry = [ $name, $mp->{volume
}, $total, $used, $avail, $pc, $path ];
393 foreach my $i (0..5) {
394 $len[$i] = length($entry->[$i])
395 if $len[$i] < length($entry->[$i]);
399 my $format = "%-$len[0]s %-$len[1]s %$len[2]s %$len[3]s %$len[4]s %$len[5]s %s\n";
400 printf($format, @$_) foreach @list;
405 PVE
::LXC
::umount_all
($vmid, $storecfg, $conf, 0);
406 PVE
::LXC
::Config-
>remove_lock($vmid, 'mounted');
412 # File creation with specified ownership and permissions.
413 # User and group can be names or decimal numbers.
414 # Permissions are explicit (not affected by umask) and can be numeric with the
415 # usual 0/0x prefixes for octal/hex.
417 my ($path, $perms, $user, $group) = @_;
419 if (defined($user)) {
420 if ($user =~ /^\d+$/) {
423 $uid = getpwnam($user);
424 die "failed to get uid for: $user\n" if !defined($uid);
427 if (defined($group)) {
428 if ($group =~ /^\d+$/) {
431 $gid = getgrnam($group);
432 die "failed to get gid for: $group\n" if !defined($gid);
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 $ctlist = PVE
::LXC
::config_list
();
710 foreach my $vmid (sort keys %$ctlist) {
711 my $cgroup = PVE
::LXC
::CGroup-
>new($vmid);
714 if (defined($path = $cgroup->get_path('cpuset', 1))) {
715 $cpuset = eval { PVE
::CpuSet-
>new_from_path($path, 1); };
716 } elsif (defined($path = $cgroup->get_path(undef, 1))) {
717 $cpuset = eval { PVE
::CpuSet-
>new_from_path($path, 1); };
719 # Container not running.
727 my @cpuset_members = $cpuset->members();
731 my $last = $cpuset_members[-1];
733 for (my $id = 0; $id <= $last; $id++) {
734 my $empty = ' ' x
length("$id");
735 $line .= ' ' . ($cpuset->has($id) ?
$id : $empty);
737 $len = length($line) if length($line) > $len;
738 $id_len = length($vmid) if length($vmid) > $id_len;
740 $res->{$vmid} = $line;
743 my @vmlist = sort keys %$res;
745 if (scalar(@vmlist)) {
746 my $header = '-' x
($len + $id_len) . "\n";
749 foreach my $vmid (@vmlist) {
750 print sprintf("%${id_len}i%s\n", $vmid, $res->{$vmid});
755 print "no running containers\n";
761 __PACKAGE__-
>register_method ({
765 description
=> "Run fstrim on a chosen CT and its mountpoints.",
767 additionalProperties
=> 0,
769 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::LXC
::complete_ctid
}),
770 'ignore-mountpoints' => {
771 description
=> 'Skip all mountpoints, only do fstrim on the container root.',
777 returns
=> { type
=> 'null' },
781 my $vmid = $param->{'vmid'};
783 my $rootdir = "/var/lib/lxc/$vmid/rootfs";
785 my $storecfg = PVE
::Storage
::config
();
786 my $conf = PVE
::LXC
::Config-
>set_lock($vmid, 'fstrim');
789 PVE
::LXC
::mount_all
($vmid, $storecfg, $conf);
790 PVE
::LXC
::Config-
>foreach_volume($conf, sub {
791 my ($name, $mp) = @_;
793 return if $param->{'ignore-mountpoints'} && $name =~ /^mp\d+/;
794 my $cmd = ["fstrim", "-v", "$rootdir$path"];
795 PVE
::Tools
::run_command
($cmd);
800 PVE
::LXC
::umount_all
($vmid, $storecfg, $conf, 0);
801 PVE
::LXC
::Config-
>remove_lock($vmid, 'fstrim');
807 list
=> [ 'PVE::API2::LXC', 'vmlist', [], { node
=> $nodename }, sub {
809 return if !scalar(@$res);
810 my $format = "%-10s %-10s %-12s %-20s\n";
811 printf($format, 'VMID', 'Status', 'Lock', 'Name');
812 foreach my $d (sort {$a->{vmid
} <=> $b->{vmid
} } @$res) {
813 my $lock = $d->{lock} || '';
814 printf($format, $d->{vmid
}, $d->{status
}, $lock, $d->{name
});
817 config
=> [ "PVE::API2::LXC::Config", 'vm_config', ['vmid'], { node
=> $nodename }, sub {
819 for my $k (sort (keys %$config)) {
820 next if $k eq 'digest' || $k eq 'lxc';
821 my $v = $config->{$k};
822 if ($k eq 'description') {
823 $v = PVE
::Tools
::encode_text
($v);
827 if (defined(my $lxc_list = $config->{'lxc'})) {
828 for my $lxc_opt (@$lxc_list) {
829 print "$lxc_opt->[0]: $lxc_opt->[1]\n"
834 pending
=> [ "PVE::API2::LXC", "vm_pending", ['vmid'], { node
=> $nodename }, \
&PVE
::GuestHelpers
::format_pending
],
835 set
=> [ 'PVE::API2::LXC::Config', 'update_vm', ['vmid'], { node
=> $nodename }],
837 resize
=> [ "PVE::API2::LXC", 'resize_vm', ['vmid', 'disk', 'size'], { node
=> $nodename } ],
839 create
=> [ 'PVE::API2::LXC', 'create_vm', ['vmid', 'ostemplate'], { node
=> $nodename }, $upid_exit ],
840 restore
=> [ 'PVE::API2::LXC', 'create_vm', ['vmid', 'ostemplate'], { node
=> $nodename, restore
=> 1 }, $upid_exit ],
841 destroy
=> [ 'PVE::API2::LXC', 'destroy_vm', ['vmid'], { node
=> $nodename }, $upid_exit ],
843 start
=> [ 'PVE::API2::LXC::Status', 'vm_start', ['vmid'], { node
=> $nodename }, $upid_exit],
844 suspend
=> [ 'PVE::API2::LXC::Status', 'vm_suspend', ['vmid'], { node
=> $nodename }, $upid_exit],
845 resume
=> [ 'PVE::API2::LXC::Status', 'vm_resume', ['vmid'], { node
=> $nodename }, $upid_exit],
846 shutdown => [ 'PVE::API2::LXC::Status', 'vm_shutdown', ['vmid'], { node
=> $nodename }, $upid_exit],
847 stop
=> [ 'PVE::API2::LXC::Status', 'vm_stop', ['vmid'], { node
=> $nodename }, $upid_exit],
848 reboot
=> [ 'PVE::API2::LXC::Status', 'vm_reboot', ['vmid'], { node
=> $nodename }, $upid_exit],
850 clone
=> [ "PVE::API2::LXC", 'clone_vm', ['vmid', 'newid'], { node
=> $nodename }, $upid_exit ],
851 migrate
=> [ "PVE::API2::LXC", 'migrate_vm', ['vmid', 'target'], { node
=> $nodename }, $upid_exit],
852 'move-volume' => [ "PVE::API2::LXC", 'move_volume', ['vmid', 'volume', 'storage', 'target-vmid', 'target-volume'], { node
=> $nodename }, $upid_exit ],
853 move_volume
=> { alias
=> 'move-volume' },
855 snapshot
=> [ "PVE::API2::LXC::Snapshot", 'snapshot', ['vmid', 'snapname'], { node
=> $nodename } , $upid_exit ],
856 delsnapshot
=> [ "PVE::API2::LXC::Snapshot", 'delsnapshot', ['vmid', 'snapname'], { node
=> $nodename } , $upid_exit ],
857 listsnapshot
=> [ "PVE::API2::LXC::Snapshot", 'list', ['vmid'], { node
=> $nodename }, \
&PVE
::GuestHelpers
::print_snapshot_tree
],
858 rollback
=> [ "PVE::API2::LXC::Snapshot", 'rollback', ['vmid', 'snapname'], { node
=> $nodename } , $upid_exit ],
859 template
=> [ "PVE::API2::LXC", 'template', ['vmid'], { node
=> $nodename }],
861 status
=> [ __PACKAGE__
, 'status', ['vmid']],
862 console
=> [ __PACKAGE__
, 'console', ['vmid']],
863 enter
=> [ __PACKAGE__
, 'enter', ['vmid']],
864 unlock
=> [ __PACKAGE__
, 'unlock', ['vmid']],
865 exec => [ __PACKAGE__
, 'exec', ['vmid', 'extra-args']],
866 fsck
=> [ __PACKAGE__
, 'fsck', ['vmid']],
868 mount
=> [ __PACKAGE__
, 'mount', ['vmid']],
869 unmount
=> [ __PACKAGE__
, 'unmount', ['vmid']],
870 push => [ __PACKAGE__
, 'push', ['vmid', 'file', 'destination']],
871 pull
=> [ __PACKAGE__
, 'pull', ['vmid', 'path', 'destination']],
873 df
=> [ __PACKAGE__
, 'df', ['vmid']],
874 rescan
=> [ __PACKAGE__
, 'rescan', []],
875 cpusets
=> [ __PACKAGE__
, 'cpusets', []],
876 fstrim
=> [ __PACKAGE__
, 'fstrim', ['vmid']],