Skip to content

Conversation

@nakomis
Copy link
Contributor

@nakomis nakomis commented Jan 12, 2018

This supercedes #35

Copy link
Member

@aledsage aledsage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I've not tried running it and not reviewed the powershell commands thoroughly.

Any windows experts/users care to comment as well?

What should we do for automated tests? Should we add windows variants of brooklyn-blockstore/catalog/catalog.tests.bom? And/or a variant of AbstractVolumeManagerLiveTest for windows (but such live tests are never run unfortunately)?

public void createFilesystem(AttachedBlockDevice attachedDevice, FilesystemOptions filesystemOptions) {
JcloudsMachineLocation machine = attachedDevice.getMachine();
if (!(machine instanceof SshMachineLocation)) {
throw new IllegalStateException("Cannot create filesystem for "+machine+" of type "+machine.getClass().getName()+"; expected "+SshMachineLocation.class.getSimpleName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we still throw this in an else block (if it's not SshMacheLocation or WinRmMachineLocation)?

public MountedBlockDevice mountFilesystem(AttachedBlockDevice attachedDevice, FilesystemOptions options) {
JcloudsMachineLocation machine = attachedDevice.getMachine();
if (!(machine instanceof SshMachineLocation)) {
throw new IllegalStateException("Cannot mount filesystem for "+machine+" of type "+machine.getClass().getName()+"; expected "+SshMachineLocation.class.getSimpleName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, should we fail if it's not ssh or winrm?

@nakomis nakomis force-pushed the feature/arm-initialize-disk-win branch 3 times, most recently from f472d9a to 1ef1b2a Compare January 12, 2018 16:08
@nakomis
Copy link
Contributor Author

nakomis commented Jan 12, 2018

@aledsage I've made the changes you requested, and am happy to look at automated tests (I think the catalog.tests.bom approach is best as that will actually get run), but can this PR be merged beforehand so that it makes it into the release?

@aledsage
Copy link
Member

@nakomis can you try to grab someone to test it on windows, or say what test you ran (e.g. which cloud/image/configuration, and example yaml for doing that)?

If it's not merged by Monday lunchtime then please do pester me again though!

@nakomis
Copy link
Contributor Author

nakomis commented Jan 15, 2018

@aledsage Sure. Here's the test YAML I used:

name: Windows with M Drive
location: west-win-azure
services:
- type: org.apache.brooklyn.entity.software.base.VanillaWindowsProcess
  name: Windows 2012 R2 Datacenter
  brooklyn.config:
    checkRunning.command: echo true
    customize.command: echo true
    lanch.command: echo true
    provisioning.properties:
      userMetadata:
        keep: keep
      customizers:
      - $brooklyn:object:
          type: io.brooklyn.blockstore.brooklyn-blockstore:brooklyn.location.blockstore.NewVolumeCustomizer
          object.fields:
            volumes:
            - blockDevice:
                sizeInGb: 3
                deviceSuffix: 'h'
                deleteOnTermination: true
              filesystem:
                mountPoint: M
                filesystemType: NTFS
                volumeLabel: My M Drive

And here's the location definition I used (creds obfuscated):

brooklyn.catalog:
  id: west-win-azure
  name: west-win-azure
  itemType: location
  item:
    type: jclouds:azurecompute-arm
    brooklyn.config:
      identity: <removed>
      credential: <removed>
      endpoint: https://management.azure.com/subscriptions/<removed>
      oauth.endpoint: https://login.microsoftonline.com/<removed>/oauth2/token
      jclouds.azurecompute.arm.publishers: MicrosoftWindowsServer
      jclouds.azurecompute.operation.timeout: 120000
 
      winrm.useHttps: true
      osFamily: windows
      imageId: westeurope/MicrosoftWindowsServer/WindowsServer/2012-R2-Datacenter
      region: westeurope
      vmNameMaxLength: 15
      useJcloudsSshInit: false
      destroyOnFailure: false
 
      templateOptions:
        overrideLoginUser: cloudsoft
        overrideLoginPassword: "<removed>"
        secrets:
        - sourceVault:
            id: "<removed>"
          vaultCertificates:
          - certificateUrl: "<removed>"
            certificateStore: My
        windowsConfiguration:
          provisionVMAgent: true
          winRM:
            listeners:
            - protocol: https
              certificateUrl: "<removed>"
          additionalUnattendContent: null
          enableAutomaticUpdates: true

I'll see if I can find someone to test it...

@nakomis nakomis force-pushed the feature/arm-initialize-disk-win branch from 1ef1b2a to 3932f43 Compare January 16, 2018 17:29
@aledsage
Copy link
Member

Thanks @nakomis. I believe that @rdowner has been looking at this with you to test and review it. He's happy with how you've tested it, but is still getting his cloud account / config for repeating your tests. As such, I'm happy to merge now.

@aledsage aledsage merged commit 6716da9 into master Jan 18, 2018
@aledsage aledsage deleted the feature/arm-initialize-disk-win branch January 18, 2018 09:10
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

Successfully merging this pull request may close these issues.

4 participants