Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
2e022063
Commit
2e022063
authored
Nov 28, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 45: skip external VMs
parent
7dcce29d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
5 deletions
+28
-5
VZDump.pm
PVE/API2/VZDump.pm
+22
-2
VZDump.pm
PVE/VZDump.pm
+6
-3
No files found.
PVE/API2/VZDump.pm
View file @
2e022063
...
...
@@ -65,7 +65,27 @@ __PACKAGE__->register_method ({
# convert string lists to arrays
my
@vmids
=
PVE::Tools::
split_list
(
extract_param
(
$param
,
'
vmid
'));
$param
->
{
vmids
}
=
PVE::VZDump::
check_vmids
(
@vmids
)
if
!
$param
->
{
all
};
my
$skiplist
=
[]
;
if
(
!
$param
->
{
all
})
{
if
(
!
$param
->
{
node
})
{
my
$vmlist
=
PVE::Cluster::
get_vmlist
();
my
@localvmids
=
();
foreach
my
$vmid
(
@vmids
)
{
my
$d
=
$vmlist
->
{
ids
}
->
{
$vmid
};
if
(
$d
&&
(
$d
->
{
node
}
ne
$nodename
))
{
push
@$skiplist
,
$vmid
;
}
else
{
push
@localvmids
,
$vmid
;
}
}
@vmids
=
@localvmids
;
# silent exit if specified VMs run on other nodes
exit
(
0
)
if
!
scalar
(
@vmids
);
}
$param
->
{
vmids
}
=
PVE::VZDump::
check_vmids
(
@vmids
)
}
my
@exclude
=
PVE::Tools::
split_list
(
extract_param
(
$param
,
'
exclude
'));
$param
->
{
exclude
}
=
PVE::VZDump::
check_vmids
(
@exclude
);
...
...
@@ -79,7 +99,7 @@ __PACKAGE__->register_method ({
die
"
you can only backup a single VM with option --stdout
\n
"
if
$param
->
{
stdout
}
&&
scalar
(
@vmids
)
!=
1
;
my
$vzdump
=
PVE::
VZDump
->
new
(
$cmdline
,
$param
);
my
$vzdump
=
PVE::
VZDump
->
new
(
$cmdline
,
$param
,
$skiplist
);
my
$worker
=
sub
{
$SIG
{
INT
}
=
$SIG
{
TERM
}
=
$SIG
{
QUIT
}
=
$SIG
{
HUP
}
=
$SIG
{
PIPE
}
=
sub
{
...
...
PVE/VZDump.pm
View file @
2e022063
...
...
@@ -416,7 +416,7 @@ my $sendmail = sub {
};
sub
new
{
my
(
$class
,
$cmdline
,
$opts
)
=
@_
;
my
(
$class
,
$cmdline
,
$opts
,
$skiplist
)
=
@_
;
mkpath
$logdir
;
...
...
@@ -450,7 +450,8 @@ sub new {
$opts
->
{
dumpdir
}
=~
s
|/+
$|
|
if
(
$opts
->
{
dumpdir
});
$opts
->
{
tmpdir
}
=~
s
|/+
$|
|
if
(
$opts
->
{
tmpdir
});
my
$self
=
bless
{
cmdline
=>
$cmdline
,
opts
=>
$opts
};
$skiplist
=
[]
if
!
$skiplist
;
my
$self
=
bless
{
cmdline
=>
$cmdline
,
opts
=>
$opts
,
skiplist
=>
$skiplist
};
#always skip '.'
push
@
{
$self
->
{
findexcl
}},
"
'('
",
'
-regex
'
,
"
'^
\\
.
\
$'
",
"
')'
",
'
-o
';
...
...
@@ -957,7 +958,9 @@ sub exec_backup {
my
$opts
=
$self
->
{
opts
};
debugmsg
('
info
',
"
starting new backup job:
$self
->{cmdline}
",
undef
,
1
);
debugmsg
('
info
',
"
skip external VMs:
"
.
join
('
,
',
@
{
$self
->
{
skiplist
}}))
if
scalar
(
@
{
$self
->
{
skiplist
}});
my
$tasklist
=
[]
;
if
(
$opts
->
{
all
})
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment