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

Add support for Azure Automation DSC (meta-config only) #126

Open
janegilring opened this issue Aug 5, 2016 · 7 comments
Open

Add support for Azure Automation DSC (meta-config only) #126

janegilring opened this issue Aug 5, 2016 · 7 comments

Comments

@janegilring
Copy link
Contributor

Consider adding support for bootstrapping only the meta-config into the VMs, so that the configurations and all others settings (credentials, global variables, etc) can be dynamically retrieved from Azure Automation.

Using the Azure Automation module, a meta-mof is created like this:

First the node must be registered

$DscNodeParameters = @{
AzureVMName = 'DC01'
AzureVMResourceGroup = 'DC01'
NodeConfigurationName = 'ServersWMF5.DC01'
ConfigurationMode = 'ApplyAndAutocorrect'
RebootNodeIfNeeded = $true
}

Register-AzureRmAutomationDscNode @DscNodeParameters

Also, the specified NodeConfigurationName must exist (regular DSC configuration uploaded to Azure).

Then the meta-config can be generated like this

Get-AzureRmAutomationDscOnboardingMetaconfig -ComputerName DC01 -OutputFolder $DSCMOFDirectory

Azure Automation DSC will generate the certificate for encryption, so no need to inject/handle that in this scenario.

This will require internet connectivity and DHCP in the virtual network though, but it would be a cool scenario.

Supporting only meta-configs could also mean supporting a regular DSC Pull Server, but in that case the certificates must be handled.

@iainbrighton
Copy link
Contributor

@janegilring I'm sure this could be accomplished, I'm just not sure how much should be built-in to Lability.

  • Lability will already inject a node's .meta.mof file if it is named correctly.
    • You can specify the -Path parameter on Start-LabConfiguration to where the .mofs are
    • This should occur even if the .mof file doesn't exist (you may get a warning)
  • A node's certificate can be defined in the .psd1 file.
    • You can set the node's ClientCertificatePath
    • This will require updating the .psd1 file, before invoking Lability.

It sounds like there's a LabilityAzure module in the making here. For example Start-AzueLabConfiguration could:

  • Register the node with Azure DSC
  • Download the .meta.mof and certificate file(s)
  • Rename/update the files as needed
  • Invoke Lability's Start-LabConfiguration cmdlet

No doubt there will need to be some additions/changes to Lability to support this; the node's PFX certificate password springs to mind. Have a think about how you think things could work and we can have a catch up in a couple of weeks when I'm back off holiday.

@janegilring
Copy link
Contributor Author

Since there are many shared needs in Lability and a possible LabilityAzure module, I'm thinking it might be worth adding a "providers" feature where Hyper-V, Azure and others can act as deployment providers. Shared code goes into the general Lability module structure, while provider specific code goes into a dedicated provider folder.

I'll give this some more thought, so let's discuss more when you're back.

@iainbrighton
Copy link
Contributor

@janegilring I'm interested to hear how you and others think we could achieve this. The real things that Lability brings are:

  1. Managing the local images
  2. Injecting resources (binaries and installers)
  3. Bootstrapping the DSC runtime.

I'm not sure (at this point in time) how we could manage 1 and 2 in an Azure. Maybe we don't and just ship the standard/stock Azure images and skip injection of resources - relying on the Azure DSC configuration?

@TravisEz13
Copy link

I'd love to see some type of azure support.

@iainbrighton
Copy link
Contributor

@TravisEz13 I've been speaking to @rikhepworth about this as he has is using the same DSC configuration(s) to deploy locally with Lability and into/onto Azure. There's a blog series in the works 😜.

I'm still interested to know if there's anything that could be added to Lability to improve the Azure "story" though!

@rikhepworth
Copy link

Azure does much of the work Lability does. I'd recommend not 'crossing the streams' here. We've got a working model for reusing DSC configs across Azure/Azure DevTest Labs/Azure Stack/Lability and I think that's model we should stick with. Our approach to media is to largely replicate the existing marketplace images in Azure (we build sysprep'ed images of Windows Server, Server+SQL, Server+SharePoint etc) and do all our config using DSC. However, the new Managed Disk support in Azure means that sharing media should be easier.

@TravisEz13 I'm hoping to get some progress on the blog stuff this weekend. @iainbrighton has kindly offered to review before I publish, but it's a big project and it will be a long series of posts, I think.

@TravisEz13
Copy link

It would be nice to be able to describe a multimachine environment with Lability and have the option to deploy it to hyper-v or Azure/AzureStack. The goal is to find a language where I can describe these environments once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants