Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vagrant-openstack windows guest #264

Closed
styk-tv opened this issue Dec 11, 2015 · 2 comments
Closed

vagrant-openstack windows guest #264

styk-tv opened this issue Dec 11, 2015 · 2 comments
Milestone

Comments

@styk-tv
Copy link

styk-tv commented Dec 11, 2015

Is there confirmed way or an example way of spinning up windows with vagrant-openstack provider?
Below is spinning my volume from image, creates an instance with winrm enabled (can telnet) but can't seem to find a way to get winrm confirmation and success. I tried many variations below lists credentials and settings twice but at no point they are picked up by vagrant-openstack plugin. Ssh seems to interfere.

require 'vagrant-openstack-provider'

Vagrant.configure('2') do |config|

config.vm.box       = 'openstack'
config.vm.guest = :windows
config.vm.communicator = 'winrm'
config.winrm.guest_port = "5985"
config.winrm.username = 'winuser'
config.winrm.password = 'winpass'

#vagrant-openstack provider can't live without below line
config.ssh.username = 'stack'
config.ssh.port = '5985'

config.vm.define :client do |ctl|

    ctl.vm.provider :openstack do |os|

        os.openstack_auth_url = 'http://192.168.7.170:5000/v2.0/tokens'
        os.username           = 'openstack_user'
        os.password           = 'openstack_pass'
        os.tenant_name        = 'openstack_tenant'
        os.flavor             = 'm1.medium'
        os.floating_ip_pool   = ['public']
        os.ssh_timeout = 600
#        os.ssh_disabled = true
        os.server_create_timeout = 1200
        os.server_active_timeout = 1200
        os.http.open_timeout = 180
        os.http.read_timeout = 180
        os.volume_boot = {
            image: '6f971b31-2ab2-4d0a-9103-16fa9065d937',
            size:  40,
            delete_on_destroy: true
        }

    end

    ctl.vm.guest = :windows
    ctl.vm.communicator = 'winrm'
    ctl.winrm.guest_port = "5985"
    ctl.winrm.username = 'winuser'
    ctl.winrm.password = 'winpass'


#    ctl.vm.provision :shell do |s|
#        s.path = "script.ps1"
#    end
end
end

Problem is that if I skip ssh alltogether:

Openstack Provider:
* vagrant standard configuration option `ssh.username` is required

when ssh.username it just keeps expecting ssh
when ssh is disabled, there is no acknowledgement of winrm (therefore no PS1 script can be executed thereafter). premature success.

then tried to fool it by switching standard 22 port to winrm 5985 but

Bringing machine 'client' up with 'openstack' provider...
==> client: Finding flavor for server...
==> client: Finding image for server...
==> client: Launching a server with the following settings...
==> client:  -- Tenant          : devopsteam
==> client:  -- Name            : client
==> client:  -- Flavor          : m1.medium
==> client:  -- FlavorRef       : 3
==> client:  -- Boot volume     :  (vda)
==> client:  -- KeyPair         : vagrant-generated-nxpnmh8c
==> client: Waiting for the server to be built...
==> client: Using floating IP 192.168.7.205
==> client: Waiting for SSH to become available...
ssh: connect to host 192.168.7.205 port 5985: No route to host
ssh: connect to host 192.168.7.205 port 5985: No route to host
ssh: connect to host 192.168.7.205 port 5985: No route to host
ssh: connect to host 192.168.7.205 port 5985: No route to host
ssh: connect to host 192.168.7.205 port 5985: No route to host
==> client: Waiting for SSH to become available...
ssh: connect to host 192.168.7.205 port 5985: No route to host
ssh_exchange_identification: Connection closed by remote host
ssh_exchange_identification: Connection closed by remote host
ssh_exchange_identification: Connection closed by remote host
ssh_exchange_identification: Connection closed by remote host

then timeout because winrm is no ssh even though winrm is ready for final success confirmation (and/or ps1 shell script)

@noresjo
Copy link

noresjo commented Feb 23, 2016

Same here. SSH seems to be an implicit requirement.

Sharpie added a commit to Sharpie/vagrant-openstack-provider that referenced this issue Apr 13, 2016
The OpenStack provider's action_up used a custom WaitForServerToBeAccessible
action to poll instances via SSH in order to determine when the VM is up and
running. One large shortcoming of this custom implementation is that it does
not support communicators other than SSH, notably WinRM. This patch replaces
the WaitForServerToBeAccessible with the built-in WaitForCommunicator action
which has been part of Vagrant since v1.3 and is able to handle multiple
communicators.

Fixes ggiamarchi#264.
Closes ggiamarchi#227.
Sharpie added a commit to Sharpie/vagrant-openstack-provider that referenced this issue Apr 13, 2016
The OpenStack provider's action_up used a custom WaitForServerToBeAccessible
action to poll instances via SSH in order to determine when the VM is up and
running. One large shortcoming of this custom implementation is that it does
not support communicators other than SSH, notably WinRM. This patch replaces
the WaitForServerToBeAccessible with the built-in WaitForCommunicator action
which has been part of Vagrant since v1.3 and is able to handle multiple
communicators.

Fixes ggiamarchi#264.
Closes ggiamarchi#227.
@Sharpie
Copy link
Contributor

Sharpie commented Apr 13, 2016

I've opened PR #281 which fixes this by switching to the standard Vagrant WaitForCommunicator middleware which handles WinRM in addition to SSH.

@ggiamarchi ggiamarchi added this to the 0.7.2 milestone Apr 30, 2016
Sharpie added a commit to Sharpie/vagrant-openstack-provider that referenced this issue Jul 25, 2016
The OpenStack provider's action_up used a custom WaitForServerToBeAccessible
action to poll instances via SSH in order to determine when the VM is up and
running. One large shortcoming of this custom implementation is that it does
not support communicators other than SSH, notably WinRM. This patch replaces
the WaitForServerToBeAccessible with the built-in WaitForCommunicator action
which has been part of Vagrant since v1.3 and is able to handle multiple
communicators.

Fixes ggiamarchi#264.
Closes ggiamarchi#227.
Sharpie added a commit to Sharpie/vagrant-openstack-provider that referenced this issue Jul 31, 2016
The OpenStack provider's action_up used a custom WaitForServerToBeAccessible
action to poll instances via SSH in order to determine when the VM is up and
running. One large shortcoming of this custom implementation is that it does
not support communicators other than SSH, notably WinRM. This patch replaces
the WaitForServerToBeAccessible with the built-in WaitForCommunicator action
which has been part of Vagrant since v1.3 and is able to handle multiple
communicators.

Fixes ggiamarchi#264.
Closes ggiamarchi#227.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants