mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 09:22:03 +00:00
implement ha config commit
This commit is contained in:
parent
a06a3eacf5
commit
6e4b266488
@ -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 {
|
||||||
@ -333,6 +350,8 @@ __PACKAGE__->register_method({
|
|||||||
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 {
|
||||||
|
|
||||||
my $conf = &$read_cluster_conf_new();
|
my $conf = &$read_cluster_conf_new();
|
||||||
@ -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({
|
|||||||
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();
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user