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

Package Hyper-V boxes #7867

Merged
merged 7 commits into from
Dec 7, 2016
Merged

Package Hyper-V boxes #7867

merged 7 commits into from
Dec 7, 2016

Conversation

bbrala
Copy link
Contributor

@bbrala bbrala commented Oct 5, 2016

First draft of packaging of Hyper-V boxes. Uses the same logic as the Virtualbox package command./

Need to refactor the package_*.rb files since right now they are copies of the virtualbox versions, might just put them in general and extend them.

Currently in my dev enviroment i run into the problem that bsdtar is not doing its job. It doesn't tar all the files for some weird reason when they are given as seperate arguments.

From the log:
"C:\\HashiCorp\\Vagrant\\embedded\\gnuwin32\\bin/bsdtar.EXE", "-czf", "G:/laragon/www/devlocal/package.box", "./Vagrantfile", "./vagrant_private_key", "./Virtual Hard Disks", "./Virtual Machines"]

  • Refactor package_*.rb files to remove duplicate code.
  • Make bsdtar work as intented
  • Clean up :)

Add or remove --base switch to select any existing virtual machine?

bbrala added 2 commits October 5, 2016 13:48
…ge_* files since right now they are copies of the virtualbox versions, might just put them in general.
@bbrala
Copy link
Contributor Author

bbrala commented Oct 6, 2016

Everything is working now, exporting a Hyper-V box and then importing it with the PR #7854. Quite awesome :)

Just need to move a few actions to General and then it seems quite fine. I could also copy the tests for Vagrant package to check at least the correct calls.

@bbrala
Copy link
Contributor Author

bbrala commented Oct 6, 2016

@chrisroberts I have a small question. I was refactoring, but it means some of the packaging code will move into the lib folder. I'm not sure if that fits the architecture. Could you provide some feedback on this?

https://github.com/bbrala/vagrant/compare/hyperv-package...bbrala:hyperv-package-refactor?expand=1

@bbrala
Copy link
Contributor Author

bbrala commented Oct 7, 2016

For testing I made a gist explaining how to get vagrant working from source on Windows.

https://gist.github.com/bbrala/7e96be8a4e26f14834e8bbc21d246c38

Just checkout the branch in the repository after running the commands in the gist.

@chrisroberts
Copy link
Member

@bbrala Skimming through the refactor branch, I don't see any glaring issues. I'm very much in favor of isolating common and duplicated behavior, so 👍. I will have a more in depth look at that branch (as well as this entire PR) this afternoon. This looks really great!

@bbrala
Copy link
Contributor Author

bbrala commented Oct 7, 2016

Ok cool! Thanks for looking into it. I will refactor the other bits the same way then tonight (its 17:23 here).

@bbrala
Copy link
Contributor Author

bbrala commented Oct 7, 2016

Ok, it wasn't much effort to change. Just can't test it at work. The --base thing is maybe a slight problem. But it might not be very easy to fix that. There is some hardcoded stuff there for VirtualBox which is kinda ugly :)

Not sure how i would go about fixing that since it means checking what virtualisation is used on that machine. Perhaps check if VirtualBox is enabled on the machine. Although you could have both installed...

https://github.com/mitchellh/vagrant/blob/f577ca3d232f470bd5eabd2ca24ebd8d10492374/plugins/commands/package/command.rb#L54-L57

XXX: This whole thing is hardcoded and very temporary. The whole

    # `vagrant package --base` process is deprecated for something much
    # better in the future. We just hardcode this to keep VirtualBox working
    # for now.

Copy link
Member

@chrisroberts chrisroberts left a comment

Choose a reason for hiding this comment

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

@bbrala Thanks for all the hard work here. This is fantastic 😃

@chrisroberts chrisroberts merged commit 23c41f4 into hashicorp:master Dec 7, 2016
@bbrala
Copy link
Contributor Author

bbrala commented Dec 7, 2016

Thank! I've been using HyperV instead of VirtualBox on Windows 10 for a while now. The performance gain is insane. Next week a the first few developers at @swisnl will move to Hyper V :)

Hopefully things will go smoothly, this will at least make repackaging easy ^^

@ghost
Copy link

ghost commented Apr 3, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants