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
14beca2c
Commit
14beca2c
authored
Mar 03, 2015
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use new PVE::Cluster::vm_is_ha_managed()
parent
2ba2236b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
14 deletions
+4
-14
OpenVZ.pm
PVE/API2/OpenVZ.pm
+4
-14
No files found.
PVE/API2/OpenVZ.pm
View file @
14beca2c
...
...
@@ -1051,16 +1051,6 @@ __PACKAGE__->register_method({
return
$res
;
}});
my
$vm_is_ha_managed
=
sub
{
my
(
$vmid
)
=
@_
;
my
$cc
=
PVE::Cluster::
cfs_read_file
('
cluster.conf
');
if
(
PVE::Cluster::
cluster_conf_lookup_pvevm
(
$cc
,
0
,
$vmid
,
1
))
{
return
1
;
}
return
0
;
};
__PACKAGE__
->
register_method
({
name
=>
'
vm_status
',
path
=>
'
{vmid}/status/current
',
...
...
@@ -1088,7 +1078,7 @@ __PACKAGE__->register_method({
my
$vmstatus
=
PVE::OpenVZ::
vmstatus
(
$param
->
{
vmid
});
my
$status
=
$vmstatus
->
{
$param
->
{
vmid
}};
$status
->
{
ha
}
=
&
$
vm_is_ha_managed
(
$param
->
{
vmid
});
$status
->
{
ha
}
=
PVE::Cluster::
vm_is_ha_managed
(
$param
->
{
vmid
});
return
$status
;
}});
...
...
@@ -1170,7 +1160,7 @@ __PACKAGE__->register_method({
die
"
CT
$vmid
already running
\n
"
if
PVE::OpenVZ::
check_running
(
$vmid
);
if
(
&
$
vm_is_ha_managed
(
$vmid
)
&&
$rpcenv
->
{
type
}
ne
'
ha
')
{
if
(
PVE::Cluster::
vm_is_ha_managed
(
$vmid
)
&&
$rpcenv
->
{
type
}
ne
'
ha
')
{
my
$hacmd
=
sub
{
my
$upid
=
shift
;
...
...
@@ -1251,7 +1241,7 @@ __PACKAGE__->register_method({
die
"
CT
$vmid
not running
\n
"
if
!
PVE::OpenVZ::
check_running
(
$vmid
);
if
(
&
$
vm_is_ha_managed
(
$vmid
)
&&
$rpcenv
->
{
type
}
ne
'
ha
')
{
if
(
PVE::Cluster::
vm_is_ha_managed
(
$vmid
)
&&
$rpcenv
->
{
type
}
ne
'
ha
')
{
my
$hacmd
=
sub
{
my
$upid
=
shift
;
...
...
@@ -1610,7 +1600,7 @@ __PACKAGE__->register_method({
if
!
$param
->
{
online
};
}
if
(
&
$
vm_is_ha_managed
(
$vmid
)
&&
$rpcenv
->
{
type
}
ne
'
ha
')
{
if
(
PVE::Cluster::
vm_is_ha_managed
(
$vmid
)
&&
$rpcenv
->
{
type
}
ne
'
ha
')
{
my
$hacmd
=
sub
{
my
$upid
=
shift
;
...
...
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