]>
git.proxmox.com Git - qemu-server.git/blob - qmrestore
5 use PVE
::Tools
qw(extract_param);
7 use PVE
::RPCEnvironment
;
9 use PVE
::JSONSchema
qw(get_standard_option);
12 use Data
::Dumper
; # fixme: remove
14 use base
qw(PVE::CLIHandler);
16 $ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
20 die "please run as root\n" if $> != 0;
22 PVE
::INotify
::inotify_init
();
24 my $rpcenv = PVE
::RPCEnvironment-
>init('cli');
26 $rpcenv->init_request();
27 $rpcenv->set_language($ENV{LANG
});
28 $rpcenv->set_user('root@pam');
30 __PACKAGE__-
>register_method({
34 description
=> "Restore QemuServer vzdump backups.",
36 additionalProperties
=> 0,
38 vmid
=> get_standard_option
('pve-vmid'),
40 description
=> "The backup file. You can pass '-' to read from standard input.",
44 storage
=> get_standard_option
('pve-storage-id', {
45 description
=> "Default storage.",
51 description
=> "Allow to overwrite existing VM.",
56 description
=> "Assign a unique random ethernet address.",
66 $param->{node
} = PVE
::INotify
::nodename
();
68 return PVE
::API2
::Qemu-
>create_vm($param);
71 my $cmddef = [ __PACKAGE__
, 'qmrestore', ['archive', 'vmid'], undef,
74 my $status = PVE
::Tools
::upid_read_status
($upid);
75 exit($status eq 'OK' ?
0 : -1);
78 push @ARGV, 'help' if !scalar(@ARGV);
80 PVE
::CLIHandler
::handle_simple_cmd
($cmddef, \
@ARGV, undef, $0);
88 qmrestore - restore QemuServer vzdump backups
96 Restore the QemuServer vzdump backup C<archive> to virtual machine
97 C<vmid>. Volumes are allocated on the original storage if there is no
102 vzdump(1) vzrestore(1)
104 =include pve_copyright