]>
git.proxmox.com Git - qemu-server.git/blob - qmrestore
6 use PVE
::Tools
qw(extract_param);
8 use PVE
::RPCEnvironment
;
10 use PVE
::JSONSchema
qw(get_standard_option);
13 use Data
::Dumper
; # fixme: remove
15 use base
qw(PVE::CLIHandler);
17 $ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
21 die "please run as root\n" if $> != 0;
23 PVE
::INotify
::inotify_init
();
25 my $rpcenv = PVE
::RPCEnvironment-
>init('cli');
27 $rpcenv->init_request();
28 $rpcenv->set_language($ENV{LANG
});
29 $rpcenv->set_user('root@pam');
31 __PACKAGE__-
>register_method({
35 description
=> "Restore QemuServer vzdump backups.",
37 additionalProperties
=> 0,
39 vmid
=> get_standard_option
('pve-vmid'),
41 description
=> "The backup file. You can pass '-' to read from standard input.",
45 storage
=> get_standard_option
('pve-storage-id', {
46 description
=> "Default storage.",
52 description
=> "Allow to overwrite existing VM.",
57 description
=> "Assign a unique random ethernet address.",
61 type
=> 'string', format
=> 'pve-poolid',
62 description
=> "Add the VM to the specified pool.",
72 $param->{node
} = PVE
::INotify
::nodename
();
74 return PVE
::API2
::Qemu-
>create_vm($param);
77 my $cmddef = [ __PACKAGE__
, 'qmrestore', ['archive', 'vmid'], undef,
80 my $status = PVE
::Tools
::upid_read_status
($upid);
81 exit($status eq 'OK' ?
0 : -1);
84 push @ARGV, 'help' if !scalar(@ARGV);
86 PVE
::CLIHandler
::handle_simple_cmd
($cmddef, \
@ARGV, undef, $0);
94 qmrestore - restore QemuServer vzdump backups
102 Restore the QemuServer vzdump backup C<archive> to virtual machine
103 C<vmid>. Volumes are allocated on the original storage if there is no
104 C<storage> specified.
108 vzdump(1) vzrestore(1)
110 =include pve_copyright