PVE::JSONSchema::register_standard_option('pve-ha-resource-id', {
description => "HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100).",
typetext => "<type>:<name>",
- type => 'string', format => 'pve-ha-resource-id',
+ type => 'string', format => 'pve-ha-resource-id',
});
PVE::JSONSchema::register_format('pve-ha-resource-or-vm-id', \&pve_verify_ha_resource_or_vm_id);
PVE::JSONSchema::register_standard_option('pve-ha-resource-or-vm-id', {
description => "HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100). For virtual machines and containers, you can simply use the VM or CT id as a shortcut (example: 100).",
typetext => "<type>:<name>",
- type => 'string', format => 'pve-ha-resource-or-vm-id',
+ type => 'string', format => 'pve-ha-resource-or-vm-id',
});
PVE::JSONSchema::register_format('pve-ha-group-node', \&pve_verify_ha_group_node);
my ($ss, $node) = @_;
my $count = 0;
-
+
foreach my $sid (keys %$ss) {
my $sd = $ss->{$sid};
next if !$sd->{node};
next;
}
}
-
+
return $count;
}
my $req = $service_conf->{state} // 'ignored';
return 'ignored' if $req eq 'ignored';
+ return 'not found' if !defined($service_conf->{node});
+
# service not yet processed by manager
return 'queued' if !defined($service_state);
my $cur = $service_state->{state};
# bash auto completion helper
+# NOTE: we use PVE::HA::Config here without declaring an 'use' clause above as
+# an hack. It uses the PVE::Cluster module from pve-cluster, which we do not
+# have nor want as dependency in the simulator - where the completion helpers
+# are never called. The PVE::CLI::ha_manager package pulls it in for us.
+
sub complete_sid {
my ($cmd, $pname, $cur) = @_;