[pve-devel] [PATCH cluster] close #4369: make VMID suggestion strategy configurable

Shannon Sterz s.sterz at proxmox.com
Wed Jun 5 10:57:56 CEST 2024


On Wed May 22, 2024 at 2:05 PM CEST, Daniel Krambrock wrote:
> Signed-off-by: Daniel Krambrock <krambrock at hrz.uni-marburg.de>
> ---
>  src/PVE/Cluster.pm          | 1 +
>  src/PVE/DataCenterConfig.pm | 9 +++++++++
>  2 files changed, 10 insertions(+)
>
> diff --git a/src/PVE/Cluster.pm b/src/PVE/Cluster.pm
> index f899dbe..059c7af 100644
> --- a/src/PVE/Cluster.pm
> +++ b/src/PVE/Cluster.pm
> @@ -84,6 +84,7 @@ my $observed = {
>      'virtual-guest/profiles.cfg' => 1,
>      'mapping/pci.cfg' => 1,
>      'mapping/usb.cfg' => 1,
> +    'used_vmids.list' => 1,
>  };
>
>  sub prepare_observed_file_basedirs {
> diff --git a/src/PVE/DataCenterConfig.pm b/src/PVE/DataCenterConfig.pm
> index abd0bbf..1394623 100644
> --- a/src/PVE/DataCenterConfig.pm
> +++ b/src/PVE/DataCenterConfig.pm
> @@ -337,6 +337,15 @@ my $datacenter_schema = {
>  	    format => $next_id_format,
>  	    description => "Control the range for the free VMID auto-selection pool.",
>  	},
> +	'next-id-strategy' => {
> +	    optional => 1,
> +	    type => 'string',
> +            enum => ['next-free', 'max+1', 'list'],
> +            default => 'next-free',
> +            description => "VMID allocation strategie. 'next-free' returns the lowerst free ID. "
> +                ."'max+1' returns the biggerst used ID + 1. "
> +                ."'list' returns the lowerst free ID that is not on the list of previously used IDs.",

Nit: Some spell-checking

- strategy, not strategie
- lowest, not lowerst
- biggest, not biggerst

> +	},
>  	migration => {
>  	    optional => 1,
>  	    type => 'string', format => $migration_format,





More information about the pve-devel mailing list