-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Hyper-v builder based on an existing hyper-v export. #4664
Conversation
@quantang I just ran a quick test of your hyperv-vhd builder on a Win 8.1 machine, and it ran without any problems. I used a "Windows Server 2016 Core" VM created and exported by the hyperv-iso builder. Based on the name I must admit that I don't quite understand why you import an existing VM. I had expected that you should copy a .vhd(x) file and create a new VM with that disk? |
Hi @ebjornset, Sorry for the confusing naming. My intention is to import some existing hyper-v export so that I can do some further processing based on the existing one, such as install/update libraries and additional products into the base image. So that I don't need to install the OS and build the image from the beginning every time. Any suggestion is welcome. |
@quantang I'm also eager to find a way to reuse images:-). I think we also can achieve this goal if the builder creates a new virtual machine from an exported .vhd(x) file. If you took this approach, we would have more flexibility in how we configure the new VM. In fact you could probably support all the hyperv-iso builder's configuration options, except disk_size, and the iso stuff. |
@ebjornset Sure, I will take a look and try to make it. Thanks for your feedback. |
@quantang your welcome. Thanks for the effort making this new builder! I just noticed that the VirtualBox and VMware builders uses 'source_path' as the configuration option for the input file, so that might be a good choice here as well. |
@ebjornset Yes, you are right. Let's make it consistent across the different builders. |
@quantang, I ran the builder with an existing, but empty "source_dir", and think the error I got was a bit imprecise:
|
@ebjornset |
@quantang How is the progress on this? Did you manage to add the ability to just use a VHD(X) file as the hard-drive? |
@pvandervelde Sorry, not yet finished this part. |
@quantang I've been using your branch (after I rebased it on master a while ago) to build a Ubuntu machine on Win10 Hyper-V. It works nicely as long as I build from an imported image that was build on the same machine. If I want to build on a different machine I need to change the network settings (different network switch). So it would still be cool if we could just use the VHD(X) file and then specify the VM settings. Other than that it works well so far. Will try building a windows box as well and see how that goes |
@quantang can you fix the merge conflicts for your pull request |
Merge the latest code from master.
# Conflicts: # command/plugin.go
Hi @taliesins, I am not sure whether I did it right, as I merged the master branch to resolve the conflicts. I also update some incorrect path name in the code. Please feel free to tell me if anything wrong. Hi @pvandervelde, I am so sorry that I did not update it for a long time since I start working in my job to catch a release. I plan to make it better after that, I hope it works for you. Sorry again. |
@quantang and @pvandervelde and @ebjornset I think we should consider rather accepting pull request #4944 and closing this pull request. It is good work but I think the other approach covers all the bases. The other pull request covers:
|
@taliesins That sounds good to me. I'm going to have to build a copy of packer with those changes to test it. |
Thanks for the PR @taliesins. Please close this out if we're moving to #4944 |
Yes, I am OK to close it. I will have a try on #4944<tel:4944> later. Thanks a lot.
发自我的小米手机
在 Taliesin Sisson <notifications@github.com>,2017年5月31日 22:30写道:
@quantang<https://github.com/quantang> are you happy we close this in favour of #4944<#4944>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#4664 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AMiUU3BczhZNbNEWmGkWelh7KRU2Q-bwks5r_UEjgaJpZM4MaxJV>.
|
Hello guys,
I tried to implement a hyper-v builder based on an existing hyper-v exports.
It follows the hyper-v iso builder approach with an additional step_import_vm function provided. The ISO installer and virtual machine creation related configuration, such as CPU and RAM, are also removed in this builder. A very simple test and documentation are provided.
It has been tested on Windows Server 2016. If anyone could help test on Windows Server 2012, that would be better. The builder will try to find the first match configuration file from source directory, which could be a XML file for Windows Server 2012 or a VMCS file for Windows Server 2016.
Any feedback is welcome.
Cheers,
Quan