2

I am trying to create a windows image in Openstack cloud using Packer. The VM is getting created successfully but the packer build is getting hanged for quite long period(30 mins) and finally throws "ui error: Build 'openstack' errored: Timeout waiting for WinRM". Please find the logs below and help me in getting this issue resolved. I have tried opening 5985 WinRM port as well but still it didn't worked.

[INFO] Attempting WinRM connection...

[DEBUG] connecting to remote shell using WinRM

[ERROR] connection error: unknown error Post http://{IP}:5985/wsman: dial tcp {IP}:5985: connection timed out

[ERROR] WinRM connection err: unknown error Post http://{IP}:5985/wsman: dial tcp {IP}:5985: connection timed out

==> openstack: Timeout waiting for WinRM.

ui error: Build 'openstack' errored: Timeout waiting for WinRM.
Flopp
  • 1,887
  • 14
  • 24
  • Attach your template, scripts, and tell which version of Windows you are using. – Rickard von Essen Feb 26 '18 at 15:00
  • Hi Rickard, Please find the Packer build file below and I already have a Windows-2012-R2 image exists in the Openstack cloud. Now I am trying to create a golden image from this base image by patching it. – Charan Reddy Feb 26 '18 at 16:27
  • { "builders": [ { "type": "openstack", "identity_endpoint": "API_Endpoint_URL", "communicator": "winrm", "winrm_username": "", "winrm_password": "", "insecure": "true", "image_name": "Packer_Windows_Image", "source_image": "IMAGE_ID", "flavor": "4", "tenant_id": "TENANT_ID", "networks": "NETWORK_ID" } ], "provisioners": [ { "type": "file", "source": "test.txt", "destination": "C:\" } ] } – Charan Reddy Feb 26 '18 at 16:29
  • Hi Rickard, The above issue is resolved now as it is because the firewall issue as both the instances are running in difference network zones. Now I have a question here, the golden image which gets created after patching from the base image of size 9 GB is getting uploaded as "SNAPSHOT" to Openstack cloud and the image is also around 40 GB in size. Is there a way where the image can be uploaded as "Image" with the same size(around 9GB) as the base image? – Charan Reddy Feb 27 '18 at 11:54
  • And the Packer version which I am using is 1.2.0 and also tried with 0.8 and 0.9, but it is not working. I have added the label "image_type": "image" to the Packer build file, but it is throwing an error - * unknown configuration key: "image_type" for all the above 3 versions – Charan Reddy Feb 27 '18 at 13:39
  • I think you are looking for the Glance support requested in https://github.com/hashicorp/packer/issues/2678. – Rickard von Essen Feb 27 '18 at 14:23

0 Answers0