better together: microsoft azure virtual machines & powershell desired state configuration

25

Upload: oleg-chorny

Post on 02-Jul-2015

277 views

Category:

Technology


3 download

DESCRIPTION

In this session you'll be introduced to the modern way of configuring Microsoft Windows Server using Powershell Desired State Configuration (DSC) and learn how DSC could be applied to any Virtual Machine in the Microsoft Azure to gain more consistency and velocity.

TRANSCRIPT

Page 1: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 2: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 3: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 4: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 5: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 6: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 7: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 8: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 9: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration

$featureName = "telnet-client"

$result = Get-WindowsFeature $featurename

if ($result.InstallState -eq "Installed") {

Write-host "$featureName already installed"}

else{

Write-host "$featureName is not installed, going to install it"Install-WindowsFeature $featureName

}

Page 10: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 11: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 12: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration

$node = "localhost"

Configuration SecondDimension{

node $node{

WindowsFeature TelnetClient{

Ensure = "Present"Name = "telnet-client"

} }

}

SecondDimensionStart-DscConfiguration -Wait -Verbose -Path .\SecondDimension -force

Page 13: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 14: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 15: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 16: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 17: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 18: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 19: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 20: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration

$subscriptionname = 'Платформы MSDN'$storageaccountname = 'dimensionsstg'$configurationpath = 'C:\Dimensions\Dimensions.ps1'$vmname = 'Dimensions-SP1'$servicename = 'dimensions'$configurationarchive = 'Dimensions.ps1.zip'$configurationname = 'Dimensions'

#Select subscriptionSelect-AzureSubscription $subscriptionname

#Select storage account where DSC configuration will be storedSet-AzureSubscription $subscriptionname -CurrentStorageAccountName $storageaccountname

#Upload configuration into the storage account. Publish-AzureVMDscConfiguration -ConfigurationPath $configurationpath -Force

#Apply DSC configuration to the $vmname$vmtoupdate = Get-AzureVM -Name $vmname -ServiceName $servicename$vmtoupdate = Set-AzureVMDSCExtension -VM $vmtoupdate `

–ConfigurationArchive $configurationarchive -ConfigurationName $configurationname$vmtoupdate | Update-AzureVM

Page 21: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 22: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 23: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration

Configuration Dimensions

{ Import-DscResource -ModuleName xSharepoint2010SP2

node 'localhost'{

xSharepoint2010SP2 Install{

Ensure = 'Present'Key = ‘ABCDE-FGHIJ-KLMNO-PQRST-12345'DownloadLink = 'https://enterurl.com/en_sharepoint_server_2010.iso'MD5FileHash = '16B6B4781336659A28898120F8EA603D'TempFolder = 'C:\Install'

}

} }

Page 24: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration
Page 25: Better Together: Microsoft Azure Virtual Machines & PowerShell Desired State Configuration

http://www.slideshare.net/jallspaw/10-deploys-per-day-dev-and-ops-cooperation-at-flickr

http://blogs.technet.com/b/privatecloud/archive/2013/08/30/introducing-powershell-desired-state-configuration-dsc.aspx

http://blogs.msdn.com/b/powershell/archive/2014/08/07/introducing-the-azure-powershell-dsc-desired-state-configuration-extension.aspx

http://technet.microsoft.com/en-us/library/dn249927.aspx

https://gallery.technet.microsoft.com/scriptcenter/DSC-Resource-Kit-All-c449312d