mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-30 16:46:51 +00:00
copy_vm: add name and description option
This commit is contained in:
parent
9076d880a8
commit
a60ab1a6a2
@ -1796,11 +1796,19 @@ __PACKAGE__->register_method({
|
|||||||
parameters => {
|
parameters => {
|
||||||
additionalProperties => 0,
|
additionalProperties => 0,
|
||||||
properties => {
|
properties => {
|
||||||
# fixme: add other parameters like name and description?
|
|
||||||
node => get_standard_option('pve-node'),
|
node => get_standard_option('pve-node'),
|
||||||
vmid => get_standard_option('pve-vmid'),
|
vmid => get_standard_option('pve-vmid'),
|
||||||
newid => get_standard_option('pve-vmid', {
|
newid => get_standard_option('pve-vmid', { description => 'VMID for the copy.' }),
|
||||||
description => 'VMID for the copy.' }),
|
name => {
|
||||||
|
optional => 1,
|
||||||
|
type => 'string', format => 'dns-name',
|
||||||
|
description => "Set a name for the new VM.",
|
||||||
|
},
|
||||||
|
description => {
|
||||||
|
optional => 1,
|
||||||
|
type => 'string',
|
||||||
|
description => "Description for the new VM.",
|
||||||
|
},
|
||||||
pool => {
|
pool => {
|
||||||
optional => 1,
|
optional => 1,
|
||||||
type => 'string', format => 'pve-poolid',
|
type => 'string', format => 'pve-poolid',
|
||||||
@ -1929,6 +1937,16 @@ __PACKAGE__->register_method({
|
|||||||
|
|
||||||
delete $newconf->{template};
|
delete $newconf->{template};
|
||||||
|
|
||||||
|
if ($param->{name}) {
|
||||||
|
$newconf->{name} = $param->{name};
|
||||||
|
} else {
|
||||||
|
$newconf->{name} = "Copy-of-$oldconf->{name}";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($param->{description}) {
|
||||||
|
$newconf->{description} = $param->{description};
|
||||||
|
}
|
||||||
|
|
||||||
PVE::Storage::activate_volumes($storecfg, $vollist);
|
PVE::Storage::activate_volumes($storecfg, $vollist);
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
|
Loading…
Reference in New Issue
Block a user