Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packer did not remove the old cloud-init on local disks #273

Open
VadimLakt opened this issue Jul 30, 2024 · 0 comments · May be fixed by #274
Open

Packer did not remove the old cloud-init on local disks #273

VadimLakt opened this issue Jul 30, 2024 · 0 comments · May be fixed by #274
Labels

Comments

@VadimLakt
Copy link

When creating an os+db image, Packer throws an error: Error updating template: ide1 - cloud-init drive is already attached at 'ide0'.

The reason is that Packer did not remove the old cloud-init and trying to insert a new one.

The removal occurs in the code: https://github.com/hashicorp/packer-plugin-proxmox/blob/main/builder/proxmox/common/step_remove_cloud_init_drive.go#L56

If you create cloud-init on local disks, the file name will also include the disk format:

 my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
        my $name = "vm-$vmid-cloudinit";

        my $fmt = undef;
        if ($scfg->{path}) {
            $fmt = $disk->{format} // "qcow2";
            $name .= ".$fmt";
        } else {
            $fmt = $disk->{format} // "raw";
        }
@VadimLakt VadimLakt added the bug label Jul 30, 2024
@VadimLakt VadimLakt linked a pull request Jul 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant