-
Notifications
You must be signed in to change notification settings - Fork 8
dsc bootstrapping in azure
Creating two new nodes with https://github.com/18F/azure-sandbox/blob/pdb/installers/dsc/vms/Two-NewSQLNodes.ps1
Trying to automate 18faz-sql1 with https://azure.microsoft.com/en-us/documentation/articles/automation-dsc-onboarding/
In the Azure portal, click Browse -> Virtual machines (classic). Select the Windows VM you want to onboard. On the virtual machine’s dashboard blade, click All settings -> Extensions -> Add -> Azure Automation DSC -> Create.
In that tile, need to add Registration URL, Registration Key, Request ID. The values for the first two are avilable in Portal -> Azure Automation account - user18faz -> Manage Keys (or the Key icon). The RequestID: Any value can be used, must be uniq every time you register a node. Using 18faz-sql1-20160926
I think the name is 'AzureAutomationDSC' but I don't see it listed when running Get-AzureVMAvailableExtension
.
From here, I still need to
- get install media to the target node
- get the additional DSC modules to the target node
Options:
- a: remote
net use
mounts.- get a publish settings files on my workstation
- copy to remote node, use to authenticate to azure
- then use DSC scripts to mount...
- b: Use archives
- In https://channel9.msdn.com/Blogs/MVP-Azure/Azure-Automation-DSC-Part-3-Onboarding-Azure-Windows-Nodes demo of using
iwr
to fetch a zip file and save it as outfile, then use expand archives.
- In https://channel9.msdn.com/Blogs/MVP-Azure/Azure-Automation-DSC-Part-3-Onboarding-Azure-Windows-Nodes demo of using
Notes about using DSC w/ Azure
- One gotcha is that the target node is going to need to get remote resources.
- So one way of doing that is mount some Azure FileStore as a UNC share on the workstation computer, and copying all of "C:\Program Files\WindowsPowerShell\modules" to I:\psmodules (and thence to the target machines)
- Likewise for the install media
- It turns out that the target node does not need any Azure Powershell modules installed, it just needs to run:
net use i: \\18fazsandbox2.file.core.windows.net\install $using:StorageKey /user:18fazsandbox2 /persistent:yes
- Logging in via
Enter-PSSession
will not see the net install, but it's there for DSC use - The use of
cmdkey
to persist credentials for net use did not work for me, the output ofnet use /list
on the target machine was always empty.
This tip from the book Learning Powershell DSC:
Remove-Item $env:systemRoot/system32/configuration/pending.mof -Force;
Get-Process *wmi* | Stop-Process -Force;
Restart-Service winrm -Force
Supposedly not needed in WMF5.
also: to remove certs:
Get-ChildItem Cert:/LocalMachine/Root | Where {$_.Subject -eq "CN=18faz-sql1.cloudapp.net"} | Remove-Item