Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Remoting causes failure to create first time through #12

Open
adrianhall opened this issue Dec 22, 2014 · 4 comments
Open

Remoting causes failure to create first time through #12

adrianhall opened this issue Dec 22, 2014 · 4 comments

Comments

@adrianhall
Copy link

The first time that packer build is run, you get errors and an incomplete build:

←[1;32m==> hyperv-iso: Configuring ip address...←[0m
←[1;32m==> hyperv-iso: ip address is 169.254.227.167←[0m
←[1;32m==> hyperv-iso: hostname is←[0m
←[1;32m==> hyperv-iso: Adding '169.254.227.167' to TrustedHosts (requires elevated mode)←[0m
←[1;31m==> hyperv-iso: Error StepRemoteSession: PowerShell error: The input object cannot be bound to any parameters for
 the command either because the command does not take pipeline input or the input and its properties do not match any of
 the parameters that take pipeline input.←[0m
←[1;32m==> hyperv-iso: Removing '169.254.227.167' from TrustedHosts←[0m
←[1;32m==> hyperv-iso: Stopping virtual machine...←[0m
←[1;32m==> hyperv-iso: Unmounting floppy drive...←[0m
←[1;32m==> hyperv-iso: Unmounting dvd drive...←[0m
←[1;32m==> hyperv-iso: Unregistering and deleting virtual machine...←[0m
←[1;32m==> hyperv-iso: Deleting output directory...←[0m
←[1;32m==> hyperv-iso: Deleting temporary directory...←[0m
←[1;31mBuild 'hyperv-iso' errored: Error StepRemoteSession: PowerShell error: The input object cannot be bound to any pa
rameters for the command either because the command does not take pipeline input or the input and its properties do not
match any of the parameters that take pipeline input.←[0m

==> Some builds didn't complete successfully and had errors:
--> hyperv-iso: Error StepRemoteSession: PowerShell error: The input object cannot be bound to any parameters for the co
mmand either because the command does not take pipeline input or the input and its properties do not match any of the pa
rameters that take pipeline input.

==> Builds finished but no artifacts were created.

The second time through, the VM is exported successfully. (I'm guessing this is because the WinRM service is not running the first time and has to be manually started).

@pbolduc
Copy link
Owner

pbolduc commented Dec 22, 2014

Hi,

I have fixed that error in my working copy. I have not had time to complete this work. Right now, I am adding the support for ssh and winrm communicator via configuration. I have found if running older versions of Windows, the WinRM configuration can have issues. That way SSH could be used.

My current version will wait for the VM to be turned off before proceeding with the provision step. This should allow for as many installation tasks as required and not getting a timeout.

I will try to get some time after work today to complete this.

@pbolduc
Copy link
Owner

pbolduc commented Dec 23, 2014

I have a working copy of the SSH communicator working. It does not require WinRM. I have been testing with a fork of the Windows 2008 R2 template that adds installing the Integration tools update and shutdowns down the VM after the install phase. It works on my machine. Your mileage may vary.

@adrianhall
Copy link
Author

Thanks for that. Any reason why you don't just set up lab remoting if it isn't set up? AutomatedLab (automatedlab.codeplex.com) does this quite nicely.

@pbolduc
Copy link
Owner

pbolduc commented Dec 23, 2014

The only reason was the lack of time and struggling to get it to work consistently. Getting WinRM setup and running in the VM is not really the responsibility of the plugin. If WinRM is configured, it is up to the end user (in the json config file) to ensure the VM is setup with WinRM enabled and accepting connections. The plugin's responsibility stops at adding and removing the VM from the host's trustedhosts configuration.

At the end of the day, I would like the Hyper-V plugin to be as close to the other provider's functionality. I am really new to Go programming struggle with the language a bit and miss being able to debug in the same way I do with my day job's C# + Visual Studio development.

I was not aware of AutomatedLab before. I will definitely poke around their source.

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

No branches or pull requests

2 participants