While we may not want to copy the cloudinit disk/drive, we still need
to create+allocate the volume, else the next start complains about a
missing CI drive..
fixes commit
7d6c99f0a0026ce07fa0eb858db7b6b7756ae021.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
} elsif (PVE::QemuServer::is_valid_drivename($opt)) {
my $drive = PVE::QemuServer::parse_drive($opt, $value);
die "unable to parse drive options for '$opt'\n" if !$drive;
} elsif (PVE::QemuServer::is_valid_drivename($opt)) {
my $drive = PVE::QemuServer::parse_drive($opt, $value);
die "unable to parse drive options for '$opt'\n" if !$drive;
- if (PVE::QemuServer::drive_is_cdrom($drive)) {
+ if (PVE::QemuServer::drive_is_cdrom($drive, 1)) {
$newconf->{$opt} = $value; # simply copy configuration
} else {
$newconf->{$opt} = $value; # simply copy configuration
} else {
+ if ($full || PVE::QemuServer::drive_is_cloudinit($drive)) {
die "Full clone feature is not supported for drive '$opt'\n"
if !PVE::Storage::volume_has_feature($storecfg, 'copy', $drive->{file}, $snapname, $running);
$fullclone->{$opt} = 1;
die "Full clone feature is not supported for drive '$opt'\n"
if !PVE::Storage::volume_has_feature($storecfg, 'copy', $drive->{file}, $snapname, $running);
$fullclone->{$opt} = 1;
print "create full clone of drive $drivename ($drive->{file})\n";
my $name = undef;
print "create full clone of drive $drivename ($drive->{file})\n";
my $name = undef;
+ if (drive_is_cloudinit($drive)) {
+ $name = "vm-$newvmid-cloudinit";
+ $name .= ".$dst_format" if $dst_format ne 'raw';
+ $snapname = undef;
+ $size = PVE::QemuServer::Cloudinit::CLOUDINIT_DISK_SIZE;
+ }
$newvolid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $newvmid, $dst_format, $name, ($size/1024));
push @$newvollist, $newvolid;
PVE::Storage::activate_volumes($storecfg, [$newvolid]);
$newvolid = PVE::Storage::vdisk_alloc($storecfg, $storeid, $newvmid, $dst_format, $name, ($size/1024));
push @$newvollist, $newvolid;
PVE::Storage::activate_volumes($storecfg, [$newvolid]);
+ if (drive_is_cloudinit($drive)) {
+ goto no_data_clone;
+ }
+
my $sparseinit = PVE::Storage::volume_has_feature($storecfg, 'sparseinit', $newvolid);
if (!$running || $snapname) {
# TODO: handle bwlimits
my $sparseinit = PVE::Storage::volume_has_feature($storecfg, 'sparseinit', $newvolid);
if (!$running || $snapname) {
# TODO: handle bwlimits
my ($size) = PVE::Storage::volume_size_info($storecfg, $newvolid, 3);
my $disk = $drive;
my ($size) = PVE::Storage::volume_size_info($storecfg, $newvolid, 3);
my $disk = $drive;