[GitHub] brooklyn-server pull request: Ability to suppress install command failures o...

2016-05-31 Thread nakomis
Github user nakomis commented on the pull request:

https://github.com/apache/brooklyn-server/pull/150
  
@bostko I've been trying to reproduce the issue manually, by provisioning a 
windows VM, installing ADDS remotely using pywinrm with 
`-NoRebootOnCompletion`, then reconnecting to reboot, then reconnecting using 
domain credentials. It all worked successfully

I think it's going to be worth spending some time looking into this - the 
`-NoRebootOnCompletion` and `INSTALL_REBOOT_REQUIRED` pattern seems much 
cleaner, even if we need to jump through some hoops to get the authentication 
working correctly

Here's my rough notes from my testing:

Created a VM:

```
services:
- type: org.apache.brooklyn.entity.software.base.VanillaWindowsProcess
  brooklyn.config:
launch.command: echo true
checkRunning.command: echo true
location: AWS Oregon Win
```

RDPd to the VM, and ran:

```
winrm set winrm/config/service/auth @{Basic="True"}
```

Then created `C:\ads.ps1`

```
Add-windowsfeature AD-Domain-Services
Import-Module ADDSDeployment
$pwd = "thepassword$!123Password"
$securepwd = ConvertTo-SecureString $pwd -AsPlainText -Force
$domainName = "mydomain.com"
$domainNetbiosName = "mydomain"
Install-ADDSForest -DomainName $domainName -DomainNetbiosName 
$domainNetbiosName -NoRebootOnCompletion -SafeModeAdministratorPassword: 
$securepwd -Force: $true
```

pywinrm to the VM and ran:

```
s = winrm.Session('52.39.83.40', auth=('Administrator', 'password'))
r = s.run_ps("C:\\ads.ps1")
r.std_out
```

Tried connecting again (success):
```
s = winrm.Session('52.39.83.40', auth=('Administrator', 'password'))
r = s.run_ps("ls")
r.std_out
```

Rebooted (success):
```
s = winrm.Session('52.39.83.40', auth=('Administrator', 'password'))
r = s.run_ps("Restart-Computer -Force")
r.std_out
```

Tried various connections... (all successful)
```
s = winrm.Session('52.39.83.40', auth=('Administrator', 'password'))
r = s.run_ps("ls")
r.std_out
```

```
s = winrm.Session('52.39.83.40', auth=('Administrator@WIN-H2SOO1DO89C', 
'password'))
r = s.run_ps("ls")
r.std_out
```

```
s = winrm.Session('52.39.83.40', auth=('Administrator@mydomain', 
'password'))
r = s.run_ps("ls")
r.std_out
```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] brooklyn-server pull request: Ability to suppress install command failures o...

2016-05-31 Thread bostko
Github user bostko commented on the pull request:

https://github.com/apache/brooklyn-server/pull/150
  
@nakomis you are right that `INSTALL_REBOOT_REQUIRED` can be used for the 
install command to complete. I think it is fare enough solution.
However for Active Directory blueprint `-NoRebootOnCompletion` won't work 
because installing Active Directory is messing up the windows authentication 
and triggering a reboot is not possible. I tried launching manually a command 
against a machine that had installed Active Directory with 
`-NoRebootOnCompletion`  and it wasn't possible to authenticate against it with 
using passing the new domain name in the user.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---