]>
git.proxmox.com Git - qemu-server.git/blob - PVE/CLI/qmrestore.pm
1 package PVE
::CLI
::qmrestore
;
6 use PVE
::Tools
qw(extract_param);
8 use PVE
::RPCEnvironment
;
10 use PVE
::JSONSchema
qw(get_standard_option);
15 use base
qw(PVE::CLIHandler);
17 sub setup_environment
{
18 PVE
::RPCEnvironment-
>setup_default_cli_env();
21 __PACKAGE__-
>register_method({
25 description
=> "Restore QemuServer vzdump backups.",
27 additionalProperties
=> 0,
29 vmid
=> get_standard_option
('pve-vmid', { completion
=> \
&PVE
::Cluster
::complete_next_vmid
}),
31 description
=> "The backup file. You can pass '-' to read from standard input.",
34 completion
=> \
&PVE
::QemuServer
::complete_backup_archives
,
36 storage
=> get_standard_option
('pve-storage-id', {
37 description
=> "Default storage.",
39 completion
=> \
&PVE
::QemuServer
::complete_storage
,
44 description
=> "Allow to overwrite existing VM.",
49 description
=> "Assign a unique random ethernet address.",
53 type
=> 'string', format
=> 'pve-poolid',
54 description
=> "Add the VM to the specified pool.",
57 description
=> "Override i/o bandwidth limit (in KiB/s).",
70 $param->{node
} = PVE
::INotify
::nodename
();
72 return PVE
::API2
::Qemu-
>create_vm($param);
75 our $cmddef = [ __PACKAGE__
, 'qmrestore', ['archive', 'vmid'], undef,
78 my $status = PVE
::Tools
::upid_read_status
($upid);
79 exit($status eq 'OK' ?
0 : -1);