Hi,

I'm having following problem. I want to create a Windows image in 
OpenStack, which has already installed Cygwin, which is configured to 
accept SSH connection. If I try to manually create the machine in 
OpenStack, I can successfully connect to it via SSH (ssh Admin@<IP 
address>). The Windows user is "Admin".

Now I want to automate it with Packer, hence I create a very simple JSON:

{
    "builders": [
   {
       "type": "openstack",
       "identity_endpoint": <url>,
       "source_image": "1284b45f-d164-43ab-9b4a-6024497b1b3f",
       "ssh_username": "Admin",
       "image_name": "Windows-packer-test"
       "flavor": "m4.xlarge",
       "floating_ip_pool": "10.8.172.0/22",
       "insecure": "true"
   }
    ],
    "provisioners": [
   {
       "type": "ansible",
       "playbook_file": "../ansible/playbooks/images/windows-image.yaml",
       "groups": ["packer"]
   }    ]
}


The Ansible playbook does simple ECHO into file. 

However, the SSH handshake always fails during the "openstack: Waiting for 
SSH to become available...", even though that when I run with -debug, after 
creation of the image and associating floating IP, I can manually connect 
to the machine via SSH, either with ssh Admin@<IP adress> or ssh -i 
os_openstack.pem Admin@<IP address>. The relevant part of output with 
PACKER_LOG=1 is here: http://pastebin.com/hRCtQe81

I don't see, why Packer would make any difference between my SSH connection 
and his, but I have to be missing something obvious, probably something 
with SSH keys, but I understand that Packer generated temporary keys, hence 
I do not have to specify any. 

The above Packer JSON works fine if I use it to create RHEL image (only 
with difference that the ssh_username is "root"). I also tried to use WinRM 
communicator, i.e. specified communicator to WinRM, correct username, 
corrent winrm port and it succeeds. The trouble is that connecting via 
WinRM ends up "jumping" onto newly created machine into PowerShell, which 
is something I don't want to do (the image should be then used for testing 
of a project and the testing on Windows machines is done via Cygwin, hence 
I need to set up the Cygwin environment).

Do you have any idea what I'm missing?
Thanks,
Jiri

-- 
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/111ce419-35ec-4025-8430-6071c0740ffc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to