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

fix for remove the old cloud-init on local disks #274

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

VadimLakt
Copy link

@VadimLakt VadimLakt commented Jul 30, 2024

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.

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";
    }

Closes #273

@VadimLakt VadimLakt requested a review from a team as a code owner July 30, 2024 09:56
Copy link

hashicorp-cla-app bot commented Jul 30, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


Vadim Laktyushin seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

@mizhka
Copy link
Contributor

mizhka commented Sep 2, 2024

Hi,

Any progress on it?

Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @VadimLakt,

Thanks for the PR! The code looks good to me, but before merging may I ask how this change fixes the issue at hand?
It's not clear to me what the controller string looks like in the case you describe, I assume there's extra data in there between the cloudinit and the media and that's why it fails with the current check, but I would appreciate if you cloud share what kind of string makes the current check fail and how the new code fixes that.

Thanks again!

@VadimLakt
Copy link
Author

Hi @lbajolet-hashicorp,

Thank you for your response.

I apologize for my delayed reply; we had difficulty accessing the problematic server. I added some debugging to the issue area, and the line that fails the check looks like this: var: vmParams[controller] value: "RAID5:154/vm-154-cloudinit.qcow2,media=cdrom,size=4M".

Between "cloudinit" and "media," there is also the disk format "qcow2."

If you need any further adjustments, feel free to let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Packer did not remove the old cloud-init on local disks
3 participants