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

Change cpu, memory and other from the config file with vboxmanage options in the packer templates #18

Open
Svieg opened this issue Dec 19, 2016 · 3 comments
Assignees

Comments

@Svieg
Copy link
Collaborator

Svieg commented Dec 19, 2016

A quick look-up told me that we could add vboxmanage options in the profiles so the user could easily modify those options in config.js

@Svieg
Copy link
Collaborator Author

Svieg commented Dec 20, 2016

That would only require to template the builder_virtualbox_windows.json snippet as I can tell

@obilodeau
Copy link
Member

Yes, we could iterate on a dict adding modifyvm lines in this list:

                "vboxmanage": [
                        ["modifyvm", "{{ '{{.Name}}' }}", "--memory", "4096"],
                        ["modifyvm", "{{ '{{.Name}}' }}", "--cpus", "1"]
                ],

Something like:

                "vboxmanage": [
                        ["modifyvm", "{{ '{{.Name}}' }}", "--memory", "4096"],
                        ["modifyvm", "{{ '{{.Name}}' }}", "--cpus", "1"],
                        {% for key, value in my_dict.iteritems() %}
                        ["modifyvm", "{{ '{{.Name}}' }}", "--{{ key }}", "{{ value }}"],
                        {% endfor %}
                ],

But we need to be careful with the dangling comma. Maybe put CPU last and without a terminating comma.

Anyway, I would 👍 such a change.

@Svieg Svieg self-assigned this Dec 27, 2016
@Svieg
Copy link
Collaborator Author

Svieg commented Dec 27, 2016

Cool, I'll check that.

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

No branches or pull requests

2 participants