[pve-devel] [PATCH storage v8 4/9] api: content: implement copying volumes between storages

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Nov 14 00:19:23 CET 2025


Am 16.09.25 um 14:36 schrieb Filip Schauer:
> @@ -532,29 +540,52 @@ __PACKAGE__->register_method({
>      name => 'copy',
>      path => '{volume}',
>      method => 'POST',
> -    description => "Copy a volume. This is experimental code - do not use.",
> +    description => "Copy a volume.",
> +    permissions => {
> +        description => "If the --delete option is used, the 'Datastore.Allocate' privilege is"
> +            . " required on the source storage."
> +            . " Without --delete, 'Datastore.AllocateSpace' is required on the target storage.",
> +        user => 'all',
> +    },
>      protected => 1,
>      proxyto => 'node',
>      parameters => {
>          additionalProperties => 0,
>          properties => {
>              node => get_standard_option('pve-node'),
> -            storage => get_standard_option('pve-storage-id', { optional => 1 }),
> +            storage => get_standard_option(
> +                'pve-storage-id',
> +                {
> +                    optional => 1,
> +                    completion => \&PVE::Storage::complete_storage_enabled,
> +                },
> +            ),
>              volume => {
>                  description => "Source volume identifier",
>                  type => 'string',
> +                completion => \&PVE::Storage::complete_volume,
>              },
> -            target => {
> -                description => "Target volume identifier",
> -                type => 'string',
> -            },
> -            target_node => get_standard_option(
> +            'target-storage' => get_standard_option(
> +                'pve-storage-id',
> +                {
> +                    description => "Target storage",
> +                    completion => \&PVE::Storage::complete_storage_enabled,
> +                },
> +            ),
> +            'target-node' => get_standard_option(
>                  'pve-node',
>                  {
>                      description => "Target node. Default is local node.",
>                      optional => 1,
>                  },
>              ),
> +            delete => {
> +                type => 'boolean',
> +                description => "Delete the original volume after a successful copy."
> +                    . " By default the original is kept.",
> +                optional => 1,
> +                default => 0,
> +            },
>          },
>      },

Can be fine to do due to this being marked as experimental in the description,
but would be really good to argue that in the commit message as it still is
exposed in the API since a long time. If something made this completely useless
until now it would be fine as is, otherwise it might make sense to keep the
"target" param as fallback?




More information about the pve-devel mailing list