]>
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 # 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-
>valid_volume_keys()],
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 = PVE
::LXC
::Config-
>parse_volume($device, $conf->{$device});
238 die "cannot run fsck when container is running\n"
239 if PVE
::LXC
::check_running
($vmid);
241 my $volid = $mount_point->{volume
};
244 my $storage_id = PVE
::Storage
::parse_volume_id
($volid, 1);
247 my (undef, undef, undef, undef, undef, undef, $format) =
248 PVE
::Storage
::parse_volname
($storage_cfg, $volid);
250 die "unable to run fsck for '$volid' (format == $format)\n"
253 $path = PVE
::Storage
::map_volume
($storage_cfg, $volid);
256 if (($volid =~ m
|^/.+|) && (-b
$volid)) {
257 # pass block devices directly
260 die "path '$volid' does not point to a block device\n";
264 push(@$command, $path);
265 PVE
::Tools
::run_command
($command);
267 PVE
::Storage
::unmap_volume
($storage_cfg, $volid) if $storage_id;
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_volume($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 $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'))) {
715 $cpuset = eval { PVE
::CpuSet-
>new_from_path($path); };
716 } elsif (defined($path = $cgroup->get_path())) {
717 $cpuset = eval { PVE
::CpuSet-
>new_from_path($path); };
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'],
818 { node
=> $nodename }, sub {
820 foreach my $k (sort (keys %$config)) {
821 next if $k eq 'digest';
823 my $v = $config->{$k};
824 if ($k eq 'description') {
825 $v = PVE
::Tools
::encode_text
($v);
829 if (defined($config->{'lxc'})) {
830 my $lxc_list = $config->{'lxc'};
831 foreach my $lxc_opt (@$lxc_list) {
832 print "$lxc_opt->[0]: $lxc_opt->[1]\n"
837 pending
=> [ "PVE::API2::LXC", "vm_pending", ['vmid'], { node
=> $nodename }, \
&PVE
::GuestHelpers
::format_pending
],
838 set
=> [ 'PVE::API2::LXC::Config', 'update_vm', ['vmid'], { node
=> $nodename }],
840 resize
=> [ "PVE::API2::LXC", 'resize_vm', ['vmid', 'disk', 'size'], { node
=> $nodename } ],
842 create
=> [ 'PVE::API2::LXC', 'create_vm', ['vmid', 'ostemplate'], { node
=> $nodename }, $upid_exit ],
843 restore
=> [ 'PVE::API2::LXC', 'create_vm', ['vmid', 'ostemplate'], { node
=> $nodename, restore
=> 1 }, $upid_exit ],
844 destroy
=> [ 'PVE::API2::LXC', 'destroy_vm', ['vmid'], { node
=> $nodename }, $upid_exit ],
846 start
=> [ 'PVE::API2::LXC::Status', 'vm_start', ['vmid'], { node
=> $nodename }, $upid_exit],
847 suspend
=> [ 'PVE::API2::LXC::Status', 'vm_suspend', ['vmid'], { node
=> $nodename }, $upid_exit],
848 resume
=> [ 'PVE::API2::LXC::Status', 'vm_resume', ['vmid'], { node
=> $nodename }, $upid_exit],
849 shutdown => [ 'PVE::API2::LXC::Status', 'vm_shutdown', ['vmid'], { node
=> $nodename }, $upid_exit],
850 stop
=> [ 'PVE::API2::LXC::Status', 'vm_stop', ['vmid'], { node
=> $nodename }, $upid_exit],
851 reboot
=> [ 'PVE::API2::LXC::Status', 'vm_reboot', ['vmid'], { node
=> $nodename }, $upid_exit],
853 clone
=> [ "PVE::API2::LXC", 'clone_vm', ['vmid', 'newid'], { node
=> $nodename }, $upid_exit ],
854 migrate
=> [ "PVE::API2::LXC", 'migrate_vm', ['vmid', 'target'], { node
=> $nodename }, $upid_exit],
855 move_volume
=> [ "PVE::API2::LXC", 'move_volume', ['vmid', 'volume', 'storage'], { node
=> $nodename }, $upid_exit ],
857 snapshot
=> [ "PVE::API2::LXC::Snapshot", 'snapshot', ['vmid', 'snapname'], { node
=> $nodename } , $upid_exit ],
858 delsnapshot
=> [ "PVE::API2::LXC::Snapshot", 'delsnapshot', ['vmid', 'snapname'], { node
=> $nodename } , $upid_exit ],
859 listsnapshot
=> [ "PVE::API2::LXC::Snapshot", 'list', ['vmid'], { node
=> $nodename }, \
&PVE
::GuestHelpers
::print_snapshot_tree
],
860 rollback
=> [ "PVE::API2::LXC::Snapshot", 'rollback', ['vmid', 'snapname'], { node
=> $nodename } , $upid_exit ],
861 template
=> [ "PVE::API2::LXC", 'template', ['vmid'], { node
=> $nodename }],
863 status
=> [ __PACKAGE__
, 'status', ['vmid']],
864 console
=> [ __PACKAGE__
, 'console', ['vmid']],
865 enter
=> [ __PACKAGE__
, 'enter', ['vmid']],
866 unlock
=> [ __PACKAGE__
, 'unlock', ['vmid']],
867 exec => [ __PACKAGE__
, 'exec', ['vmid', 'extra-args']],
868 fsck
=> [ __PACKAGE__
, 'fsck', ['vmid']],
870 mount
=> [ __PACKAGE__
, 'mount', ['vmid']],
871 unmount
=> [ __PACKAGE__
, 'unmount', ['vmid']],
872 push => [ __PACKAGE__
, 'push', ['vmid', 'file', 'destination']],
873 pull
=> [ __PACKAGE__
, 'pull', ['vmid', 'path', 'destination']],
875 df
=> [ __PACKAGE__
, 'df', ['vmid']],
876 rescan
=> [ __PACKAGE__
, 'rescan', []],
877 cpusets
=> [ __PACKAGE__
, 'cpusets', []],
878 fstrim
=> [ __PACKAGE__
, 'fstrim', ['vmid']],