GitHub user bostko opened a pull request:

    https://github.com/apache/brooklyn-server/pull/110

    Verify windows up time parameter.

    The problem this PR tries to solve is that In some clouds a restart could 
happen on a Windows Host 2 minutes after it is provisioned. This could be 
because of System Upgrade or other.
    
    What particularly I experience is that this Blueprint fail:
    ```yaml
    services:
      type: org.apache.brooklyn.entity.software.base.VanillaWindowsProcess
      brooklyn.config:
        pre.install.command: echo preInstallCommand
        install.command: echo installCommand > C:\\install.txt
        post.install.command: echo postInstallCommand
        customize.command: echo customizeCommand
        pre.launch.command: echo preLaunchCommand
        launch.powershell.command: |
          Start-Sleep -s 400
          Write-Host Test Completed
        post.launch.command: echo postLaunchCommand
        checkRunning.command: echo checkRunningCommand
        stop.command: echo stopCommand
    ```
    
    When I login on the host and search for System event of type 1074 in 
Windows Event Viewer, there is
    ```none
    The process C:\Windows\system32\winlogon.exe (W2K12-STD) has initiated the 
restart of computer WIN-JV0CGR5J6GN on behalf of user NT AUTHORITY\SYSTEM for 
the following reason: Operating System: Upgrade (Planned) Reason Code: 
0x80020003 Shutdown Type: restart Comment:
    ```
     
    -----
    With this config key Brooklyn will wait 5 minutes for a restart to happen 
before returning the machine as accessible. With this config Brooklyn waits 
before giving the machine to the entity and the blueprint succeeds.
    
    I tried adding Get-PendingReboot script from  
[gallery.technet.microsoft.com](https://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542)
 but every time it executes it tells that no restarts are pending and again it 
restarts.
    I left out commented code so you can test Get-PendingReboot yourself.
    
    Do you think adding this option is enough or I should investigate further 
why it restarts?

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/bostko/brooklyn-server windows_up

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/110.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #110
    
----
commit dca56a71d280e0f317735273bcd355cb028eaf58
Author: Valentin Aitken <[email protected]>
Date:   2016-04-11T08:09:14Z

    Verify windows up time parameter.
    
    - Sometimes restart could happen after a Windows VM is provisioned. This 
could be because of System Upgrade or other.
      With this parameter Brooklyn will wait 5 minutes for a restart to happen 
before returning the machine as accessible.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to