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
8ec1281b
Commit
8ec1281b
authored
Dec 22, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement ha config commit
parent
b6c4b9ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
HAConfig.pm
PVE/API2/HAConfig.pm
+29
-6
HAConfig.js
www/manager/dc/HAConfig.js
+1
-1
No files found.
PVE/API2/HAConfig.pm
View file @
8ec1281b
...
@@ -175,17 +175,34 @@ __PACKAGE__->register_method({
...
@@ -175,17 +175,34 @@ __PACKAGE__->register_method({
additionalProperties
=>
0
,
additionalProperties
=>
0
,
properties
=>
{},
properties
=>
{},
},
},
returns
=>
{
returns
=>
{
type
=>
"
null
"
},
type
=>
"
object
",
properties
=>
{},
},
code
=>
sub
{
code
=>
sub
{
my
(
$param
)
=
@_
;
my
(
$param
)
=
@_
;
my
$rpcenv
=
PVE::RPCEnvironment::
get
();
my
$cmd
=
['
ccs_config_validate
',
'
-l
',
'
/etc/pve/cluster.conf.new
'];
my
$out
=
'';
eval
{
# first line on stderr contains error message
PVE::Tools::
run_command
(
$cmd
,
errfunc
=>
sub
{
$out
.=
shift
if
!
$out
;
});
};
if
(
my
$err
=
$@
)
{
chomp
$out
;
$out
=
"
unknown error
"
if
!
$out
;
die
"
config validation failed:
$out
\n
";
}
die
"
not implemented
"
;
PVE::Cluster::
check_cfs_quorum
()
;
my
$code
=
sub
{
if
(
!
rename
('
/etc/pve/cluster.conf.new
',
'
/etc/pve/cluster.conf
'))
{
die
"
commit failed - $!
\n
";
}
};
cfs_lock_file
('
cluster.conf
',
undef
,
$code
);
die
$@
if
$@
;
return
;
}});
}});
my
$read_cluster_conf_new
=
sub
{
my
$read_cluster_conf_new
=
sub
{
...
@@ -332,6 +349,8 @@ __PACKAGE__->register_method({
...
@@ -332,6 +349,8 @@ __PACKAGE__->register_method({
my
$vmlist
=
PVE::Cluster::
get_vmlist
();
my
$vmlist
=
PVE::Cluster::
get_vmlist
();
raise_param_exc
({
id
=>
"
no such vmid '
$param
->{vmid}'
"})
raise_param_exc
({
id
=>
"
no such vmid '
$param
->{vmid}'
"})
if
!
(
$vmlist
&&
$vmlist
->
{
ids
}
&&
$vmlist
->
{
ids
}
->
{
$param
->
{
vmid
}});
if
!
(
$vmlist
&&
$vmlist
->
{
ids
}
&&
$vmlist
->
{
ids
}
->
{
$param
->
{
vmid
}});
PVE::Cluster::
check_cfs_quorum
();
my
$code
=
sub
{
my
$code
=
sub
{
...
@@ -386,6 +405,8 @@ __PACKAGE__->register_method({
...
@@ -386,6 +405,8 @@ __PACKAGE__->register_method({
raise_param_exc
({
id
=>
"
unsupported group type '
$param
->{id}'
"});
raise_param_exc
({
id
=>
"
unsupported group type '
$param
->{id}'
"});
}
}
PVE::Cluster::
check_cfs_quorum
();
my
$code
=
sub
{
my
$code
=
sub
{
my
$conf
=
&
$read_cluster_conf_new
();
my
$conf
=
&
$read_cluster_conf_new
();
...
@@ -475,6 +496,8 @@ __PACKAGE__->register_method({
...
@@ -475,6 +496,8 @@ __PACKAGE__->register_method({
code
=>
sub
{
code
=>
sub
{
my
(
$param
)
=
@_
;
my
(
$param
)
=
@_
;
PVE::Cluster::
check_cfs_quorum
();
my
$code
=
sub
{
my
$code
=
sub
{
my
$conf
=
&
$read_cluster_conf_new
();
my
$conf
=
&
$read_cluster_conf_new
();
...
...
www/manager/dc/HAConfig.js
View file @
8ec1281b
...
@@ -170,7 +170,7 @@ Ext.define('PVE.dc.HAConfig', {
...
@@ -170,7 +170,7 @@ Ext.define('PVE.dc.HAConfig', {
{
{
text
:
gettext
(
'
HA managed VM/CT
'
),
text
:
gettext
(
'
HA managed VM/CT
'
),
handler
:
function
()
{
handler
:
function
()
{
if
(
!
me
.
clusterInfo
.
fenceDevices
)
{
if
(
false
&&
!
me
.
clusterInfo
.
fenceDevices
)
{
Ext
.
Msg
.
alert
(
gettext
(
'
Error
'
),
gettext
(
"
Please configure fencing first!
"
));
Ext
.
Msg
.
alert
(
gettext
(
'
Error
'
),
gettext
(
"
Please configure fencing first!
"
));
return
;
return
;
}
}
...
...
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