[pve-devel] [PATCH] HA parse_sid changed to accept CT

Dietmar Maurer dietmar at proxmox.com
Tue Sep 1 10:10:38 CEST 2015



On 08/31/2015 03:48 PM, Alen Grizonic wrote:
> ---
>   
> @@ -69,8 +70,14 @@ sub parse_sid {
>   
>       if ($sid =~ m/^(\d+)$/) {
>   	$name = $1;
> -	$type ='vm';
> -	$sid = "vm:$name";
> +	my $vmlist = PVE::Cluster::get_vmlist();
> +	my $type = $vmlist->{ids}->{$name}->{type};
what if the VM/CT does not exists?
> +	if ($type eq 'lxc') {
> +	    $type = 'ct';
> +	} elsif ($type eq 'qemu') {
> +	    $type = 'vm';
> +	}
> +	$sid = "$type:$name";
>       } elsif  ($sid =~m/^(\S+):(\S+)$/) {
>   	$name = $2;
>   	$type = $1;




More information about the pve-devel mailing list