Ability to not export and leave VM sitting in Hyper-v

67 views
Skip to first unread message

M Black

unread,
Oct 12, 2018, 9:49:30 PM10/12/18
to Packer
Is there a way to have the hyper-v builder not export the VM after its built?
So far I am able to create a VM from scratch, install centos with a kickstart file all with one command which is amazing.
However the way packer works is to also export it, is there a way to skip this step? I want my build to stay sitting in Hyper-v after its being built.
That way packer would be an amazing deployment tool for production hyper-v VM's and so much better than anything I have found yet.
Is this possible?

lucas.adam.jackson

unread,
Oct 12, 2018, 10:26:03 PM10/12/18
to packe...@googlegroups.com
Use skip_export: true



Sent from my Samsung Galaxy smartphone.
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/59677afd-5e9f-43a6-ad10-8d75742341c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

M Black

unread,
Oct 13, 2018, 12:54:17 AM10/13/18
to Packer
skip_export: true still unregisters the machine from hyper-v and leaves the vhdx files and nothing else.

I thought an option like this should be possible but it seems I am incorrect.

M Black

unread,
Oct 13, 2018, 1:45:14 AM10/13/18
to Packer
And looking further into it I think I could achieve this with a powershell post processor to run import-vm and bring it back into hyper-v.
I can use the builder to already have the vm at the correct path so it would just be a simple in-place import of the VM.

The next step would be to also have this post processor make the vm highly available in the cluster.

I could then have packer on each of my cluster nodes and have a powershell script that asks a few questions then runs packer on the chosen host using invoke-command and running the build then importing it back into hyper-v.

Christopher Campbell

unread,
Oct 13, 2018, 7:25:19 AM10/13/18
to Packer
Why don't you use terraform then? Packer is more for creating custom images while terraform is to create things

lucas.adam.jackson

unread,
Oct 13, 2018, 8:43:37 AM10/13/18
to packe...@googlegroups.com
There is an option in the VMware builder called keep_registered which achieves what you're talking about, but I dont believe this exists for the hyperv builder.



Sent from my Samsung Galaxy smartphone.

-------- Original message --------
From: Christopher Campbell <cgcamp...@gmail.com>
Date: 2018-10-13 7:25 AM (GMT-05:00)
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.

M Black

unread,
Oct 27, 2018, 6:34:15 AM10/27/18
to Packer
Would love to see this feature surely it wouldn't be to hard to implement the keep_registered functionality. It would make sense to support the same functionality for the hyper-v builder that the vmware builder has, where possible.

The ability to keep_registered would be revolutionary for me.

dean warren

unread,
Oct 27, 2018, 7:05:15 AM10/27/18
to packe...@googlegroups.com
Any chance I can have a copy of you packer file as I am looking to do similar?


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages