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

Add option to destroy vifs #43

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

heindsight
Copy link

Add the option to destroy vifs prior to exporting the VM.

@ddelnano
Copy link
Owner

I'm so sorry for the late reply on this and greatly appreciate you taking the time to improve the packer plugin! I've had a ton of travel, personal things and my contributions to another project have been taking up my time.

I plan to look at this within the next week or two!

Comment on lines +76 to +79
* `destroy_vifs` (boolean) - Whether to destroy VIFs on the VM prior to
exporting. Removing them may make the image more generic and reusable.
Default is `false`.

Copy link
Owner

@ddelnano ddelnano Apr 14, 2023

Choose a reason for hiding this comment

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

@heindsight can you explain a scenario where having the VIFs remain hurts the template's reusability? I understand the general sentiment that it is unnecessary to include extra configuration, but I don't quite see where this could manifest to a concrete problem.

Copy link
Author

Choose a reason for hiding this comment

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

@ddelnano to be honest, I have not encountered such a situation myself. I cherry picked this from another fork that we were previously using at Sohonet because we have a number of existing templates that use this option.

The main reason for originally using this option in our templates really is just to avoid including unnecessary extra configuration.

Choose a reason for hiding this comment

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

Hello - I couldn't resist chiming in.

On the surface, it seems sloppy to leave a 10MB container that will never be used again. Or is there an example where it could be?

What will happen if it is left in place and ends up inside a template. Will we get TWO of these things when a VM is deployed from the template, and if so - will the "current" or new one be used correctly for deployment?

Or instead will a new deployment just overwrite the existing one?

How will a Windows VM react to a snapshot request with a drive like this hanging around?

Additionally, it seems wasteful - I know we live in an age where we can be sloppy with diskspace because you can get 1TB drive for $40 or so, so... who cares about soaking up 10MB on these things. But not all VMs run on cheap harddrives

In principal, it would seem to be best if temporary drives were really temporary and cleaned up after the fact. Garbage collection seems to be a good practice, whether in terms of RAM or disk space.

Copy link
Author

Choose a reason for hiding this comment

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

@Roche-Mike this PR adds an option to remove virtual network interfaces from the the VM template. It has nothing to do with any 10MB temporary drive.

Copy link
Owner

Choose a reason for hiding this comment

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

On the surface, it seems sloppy to leave a 10MB container that will never be used again. Or is there an example where it could be?

@Roche-Mike as Heinrich mentioned, this should be unrelated to what you described. However, I am interested in what you are describing and it's something we should consider if the plugin is having the correct behavior. Can you please open a new issue with the relevant context so we can have a focused discussion on that behavior?

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.

4 participants