summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8c80973)
only count up target selection if that node is already in the online
node usage list, to avoid that a offline node is considered online if
its a target from any command
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
foreach my $sid (keys %{$self->{ss}}) {
my $sd = $self->{ss}->{$sid};
my $state = $sd->{state};
foreach my $sid (keys %{$self->{ss}}) {
my $sd = $self->{ss}->{$sid};
my $state = $sd->{state};
+ my $target = $sd->{target}; # optional
if (defined($online_node_usage->{$sd->{node}})) {
if (
$state eq 'started' || $state eq 'request_stop' || $state eq 'fence' ||
if (defined($online_node_usage->{$sd->{node}})) {
if (
$state eq 'started' || $state eq 'request_stop' || $state eq 'fence' ||
} elsif (($state eq 'migrate') || ($state eq 'relocate')) {
# count it for both, source and target as load is put on both
$online_node_usage->{$sd->{node}}++;
} elsif (($state eq 'migrate') || ($state eq 'relocate')) {
# count it for both, source and target as load is put on both
$online_node_usage->{$sd->{node}}++;
- $online_node_usage->{$sd->{target}}++;
+ $online_node_usage->{$target}++;
} elsif ($state eq 'stopped') {
# do nothing
} else {
die "should not be reached (sid = '$sid', state = '$state')";
}
} elsif ($state eq 'stopped') {
# do nothing
} else {
die "should not be reached (sid = '$sid', state = '$state')";
}
- } elsif (defined(my $target = $sd->{target})) {
+ } elsif (defined($target) && defined($online_node_usage->{$target})) {
if ($state eq 'migrate' || $state eq 'relocate') {
# to correctly track maintenance modi and also consider the target as used for the
# case a node dies, as we cannot really know if the to-be-aborted incoming migration
if ($state eq 'migrate' || $state eq 'relocate') {
# to correctly track maintenance modi and also consider the target as used for the
# case a node dies, as we cannot really know if the to-be-aborted incoming migration