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
c69fc44a
Commit
c69fc44a
authored
Dec 15, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup status log for ha agent
parent
f2040340
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
pvevm
bin/ocf/pvevm
+16
-9
No files found.
bin/ocf/pvevm
View file @
c69fc44a
...
...
@@ -29,7 +29,8 @@ use constant OCF_FAILED_MASTER => 9;
$ENV
{'
PATH
'}
=
'
/sbin:/bin:/usr/sbin:/usr/bin
';
my
$ocf_ressource_type
=
$0
;
my
$ocf_ressource_type
=
'
pvevm
';
my
$prio_hash
=
{
err
=>
3
,
note
=>
5
,
...
...
@@ -121,6 +122,12 @@ sub validate_all {
$status
->
{
type
}
=
$data
->
{
type
};
$status
->
{
node
}
=
$data
->
{
node
};
if
(
$status
->
{
type
}
eq
'
qemu
')
{
$status
->
{
name
}
=
"
VM
$vmid
";
}
else
{
$status
->
{
name
}
=
"
CT
$vmid
";
}
check_running
(
$status
);
};
if
(
my
$err
=
$@
)
{
...
...
@@ -151,12 +158,12 @@ die "too many arguments\n" if scalar (@ARGV) != 0;
if
(
$cmd
eq
'
start
')
{
my
$status
=
validate_all
();
if
(
$status
->
{
running
})
{
ocf_log
('
info
',
"
Resource
is already running
");
ocf_log
('
info
',
"
$status
->{name}
is already running
");
exit
(
OCF_SUCCESS
);
}
if
(
$status
->
{
node
}
ne
$nodename
)
{
ocf_log
('
info
',
"
Move config to local node
");
ocf_log
('
info
',
"
Move config
for
$status
->{name}
to local node
");
my
(
$oldconfig
,
$newconfig
);
if
(
$status
->
{
type
}
eq
'
qemu
')
{
$oldconfig
=
PVE::QemuServer::
config_file
(
$status
->
{
vmid
},
$status
->
{
node
});
...
...
@@ -195,7 +202,7 @@ if ($cmd eq 'start') {
eval
{
PVE::Tools::
run_with_timeout
(
$timeout
,
$wait_func
);
};
if
(
my
$err
=
$@
)
{
ocf_log
('
err
',
"
Start of
VM
$status
->{vmid
} has failed
");
ocf_log
('
err
',
"
Start of
$status
->{name
} has failed
");
ocf_log
('
err
',
"
error while waiting for '
$testprog
' -
$err
");
exit
(
OCF_ERR_GENERIC
);
}
...
...
@@ -207,7 +214,7 @@ if ($cmd eq 'start') {
my
$status
=
validate_all
();
if
(
!
$status
->
{
running
})
{
ocf_log
('
info
',
"
Resource
is already stopped
");
ocf_log
('
info
',
"
$status
->{name}
is already stopped
");
exit
(
OCF_SUCCESS
);
}
...
...
@@ -243,11 +250,11 @@ if ($cmd eq 'start') {
my
$status
=
validate_all
();
if
(
!
$status
->
{
running
})
{
ocf_log
('
debug
',
"
Resource
is not running
");
ocf_log
('
debug
',
"
$status
->{name}
is not running
");
exit
(
OCF_NOT_RUNNING
);
}
ocf_log
('
debug
',
"
Resource
is running
");
ocf_log
('
debug
',
"
$status
->{name}
is running
");
my
$testprog
=
$ENV
{
OCF_RESKEY_status_program
};
my
$checklevel
=
$ENV
{
OCF_CHECK_LEVEL
};
...
...
@@ -263,7 +270,7 @@ if ($cmd eq 'start') {
}
elsif
(
$cmd
eq
'
migrate
')
{
my
$status
=
validate_all
();
if
(
!
$status
->
{
running
})
{
ocf_log
('
err
',
"
Resource
is not running
");
ocf_log
('
err
',
"
$status
->{name}
is not running
");
exit
(
OCF_ERR_GENERIC
);
}
...
...
@@ -299,7 +306,7 @@ if ($cmd eq 'start') {
my
$status
=
validate_all
();
if
(
!
$status
->
{
running
})
{
ocf_log
('
info
',
"
Resource
is already stopped
");
ocf_log
('
info
',
"
$status
->{name}
is already stopped
");
exit
(
OCF_SUCCESS
);
}
...
...
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