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',
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;
}});
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;
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;
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;