I was wondering if someone could help me understand where the process is
breaking.
I am building a EC2 AMI from a good know EC2 AMI not build by packer as
everything run as expected (as you can see blow). Then I run the same
process after my new AMI created and try to run the process off the new
packer created AMI and the process fails just after "Connected to WinRM!"
with error "Error processing command: Error uploading ps script containing
env vars: Error removing temporary file"
I am a little confused as to what has happened to the packer AMI to stop
this running as it should?
ubuntu@ip-10-252-75-132:/home/packer/Win2012AMI$ packer build -var
ami_name=Test -var ami_description=descriptiontest Win2012AMI.jsonC8 output
will be in this color.
==> C8: Prevalidating AMI Name: Test
C8: Found Image ID: ami-4227543a
==> C8: Creating temporary keypair:
packer_5afea24f-9c59-ccc5-2ae1-928863d294d9
==> C8: Creating temporary security group for this instance:
packer_5afea252-29f2-d956-e0ee-454ea1281266
==> C8: Authorizing access to port 5985 from 0.0.0.0/0 in the temporary
security group...
==> C8: Launching a source AWS instance...
==> C8: Adding tags to source instance
C8: Adding tag: "Name": "Packer Builder"
C8: Instance ID: i-0201c56364b43934a
==> C8: Waiting for instance (i-0201c56364b43934a) to become ready...
==> C8: Skipping waiting for password since WinRM password set...
==> C8: Waiting for WinRM to become available...
C8: WinRM connected.
==> C8: Connected to WinRM!
==> C8: Provisioning with Powershell...
==> C8: Provisioning with powershell script:
/home/packer/Win2012AMI/scripts/set_ec2_config.ps1
==> C8: Provisioning with Powershell...
==> C8: Provisioning with powershell script:
/home/packer/Win2012AMI/scripts/clear_logs.ps1
==> C8: Stopping the source instance...
C8: Stopping instance, attempt 1
==> C8: Waiting for the instance to stop...
==> C8: Creating the AMI: Test
C8: AMI: ami-38047837
==> C8: Waiting for AMI to become ready...
==> C8: Modifying attributes on AMI (ami-38047840)...
C8: Modifying: description
==> C8: Modifying attributes on snapshot (snap-021af3b8d43ff4a83d4a)...
==> C8: Modifying attributes on snapshot (snap-03d24346d2hf658be)...
==> C8: Adding tags to AMI (ami-38047840)...
==> C8: Tagging snapshot: snap-021af3b8d43ff4a83d4a
==> C8: Tagging snapshot: snap-03d24346d2hf658be
==> C8: Creating AMI tags
C8: Adding tag: "AMI_Produced": "Packer"
C8: Adding tag: "Cost_Code": "DocGen"
==> C8: Creating snapshot tags
==> C8: Terminating the source AWS instance...
==> C8: Cleaning up any extra volumes...
==> C8: No volumes to clean up, skipping
==> C8: Deleting temporary security group...
==> C8: Deleting temporary keypair...
Build 'C8' finished.
==> Builds finished. The artifacts of successful builds are:
--> C8: AMIs were created:
us-west-2: ami-38047837
ubuntu@ip-10-252-75-132:/home/packer/Win2012AMI$ packer build -var
ami_name=Test2 -var ami_description=descriptiontest Win2012AMI.json
C8 output will be in this color.
==> C8: Prevalidating AMI Name:Test2
C8: Found Image ID: ami-38047837
==> C8: Creating temporary keypair:
packer_5afea460-6c91-6c99-294d-99abef82bae5
==> C8: Creating temporary security group for this instance:
packer_5afea463-a50f-69b9-fd0f-28ecf105380e
==> C8: Authorizing access to port 5985 from 0.0.0.0/0 in the temporary
security group...
==> C8: Launching a source AWS instance...
==> C8: Adding tags to source instance
C8: Adding tag: "Name": "Packer Builder"
C8: Instance ID: i-0c64318e6ee33cb803
==> C8: Waiting for instance (i-0c64318e60adf7b803) to become ready...
==> C8: Skipping waiting for password since WinRM password set...
==> C8: Waiting for WinRM to become available...
C8: WinRM connected.
==> C8: Connected to WinRM!
==> C8: Provisioning with Powershell...
==> C8: Provisioning with powershell script:
/home/packer/Win2012AMI/scripts/set_ec2_config.ps1
==> C8: Provisioning with Powershell...
==> C8: Provisioning with powershell script:
/home/packer/Win2012AMI/scripts/clear_logs.ps1
==> C8: Terminating the source AWS instance...
==> C8: Cleaning up any extra volumes...
==> C8: No volumes to clean up, skipping
==> C8: Deleting temporary security group...
==> C8: Deleting temporary keypair...
Build 'C8' errored: Error processing command: Error uploading ps script
containing env vars: Error removing temporary file
$env:TEMP\winrmcp-1d8c5a70-92eb-4908-588f-0b0658556688.tmp: http response
error: 401 - invalid content type
==> Some builds didn't complete successfully and had errors:
--> C8: Error processing command: Error uploading ps script containing env
vars: Error removing temporary file
$env:TEMP\winrmcp-1d8c5a70-92eb-4908-588f-0b0658556688.tmp: http response
error: 401 - invalid content type
==> Builds finished but no artifacts were created.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/packer-tool/6480de51-337e-478a-af18-e3821e146128%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.