Desired State Configuration and VMware Orchestrator


This blog post is a follow up on : Creating servers and keeping basic configuration consistent and compliant. I will add more text in the coming week.

Because vRealize Orchestrator is very easily accessible for everyone using the vSphere WebClient I think that vRealize Orchestrator is an excellent tool to create servers with great consistency. However what is lacking in vRealize Orchestrator is the ability to keep a consistent configuration in the Guest OS itself.

I belief that Desired State Configuration is a great tool to accomplish the consistency in the Guest OS and rather than speaking about the advantages of vRealize Orchestrator vs DSC I would say DSC is the ideal partner in crime for vRealize Orchestrator!

Please take note that I do not use the Experimental DSC Resource Kit anymore. I have used a clean install of the Windows Management Framework 5 Production Preview. TheWMF5PP has to be installed manually on all operating systems. If you have issues running the scripts, consider downloading the Windows Management Framework 5 Production Preview. Click on the download button to be redirected to the WMF5PP installer

download

On Windows 2008R2 and Windows 7, make sure WinRM is running [click here] and is not blocked by the Windows Firewall.

The following examples are examples using a PUSH configuration because it is easier to show and to apply. Keep in mind that a PUSH configuration has to be applied manually each time, there is no automatic synchronization between the slave server and the DSC server.

The following scripts are an example of parts of configuration you can create to manage the consistency of the Guest OS of the Management WKS you might be using to manage your environment. (Not all services and features you might need are included!). Some time in the future I will show you my PULL configurations as well. But all in due time.

I have added 4 possible scripts below the screenshots. Feel free to copy and use them. Again they might not be complete for your use case.

  • Set services and Features on multiple servers at the same time
  • Add software to multiple servers at the same time

dsc

services

client

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Services and Features Script:

 

# Create the ConfigData and select all ADMIN Servers in a HASH table under AllNodes
# Create the configuration data and run it against all nodes

$ConfigData = @{
AllNodes = @(
@{
NodeName = ‘yourServer1’
},
@{
NodeName = ‘yourServer2’
},
@{
NodeName = ‘yourServer3’
},
@{
NodeName = ‘yourServer4’
}

)
}
configuration AllAdminServers_ServicesAndFeatures
{
param (
)
Import-DscResource -ModuleName PSDesiredStateConfiguration;

Node $AllNodes.NodeName {

WindowsFeature DNS {
Ensure = “Present”
Name = “RSAT-DNS-SERVER”
}
WindowsFeature NET35 {
Ensure = “Present”
Name = “NET-Framework-Core”
}
WindowsFeature NET45 {
Ensure = “Present”
Name = “NET-Framework-45-Core”
}
WindowsFeature Powershell {
Ensure = “Present”
Name = “Powershell”
}
WindowsFeature Powershell-ISE {
Ensure = “Present”
Dependson = “[WIndowsfeature]Powershell”
Name = “Powershell-ISE”
}
WindowsFeature DSC-Service {
Ensure = “Present”
Dependson = “[WIndowsfeature]Powershell”
Name = “DSC-Service”
}
WindowsFeature RSAT-AD-Tools {
Ensure = “Present”
Name = “RSAT-AD-Tools”
}
}

}
}
AllAdminServers_ServicesAndFeatures -ConfigurationData $ConfigData

Push Configuration for Services and Features:

Start-DscConfiguration –Wait –Verbose -Force –Path .\AllAdminServers_ServicesAndFeatures

Software Script:

#Take note I copy the installers locally to the servers I want to install the software on.
$ConfigData = @{
AllNodes = @(
@{
NodeName = 'yourServer1'
},
@{
NodeName = 'yourServer2'
},
@{
NodeName = 'yourServer3'
},
@{
NodeName = 'yourServer4'
}
)
}
configuration AllAdminServers_Software
{
param (
)
Import-DscResource -ModuleName PSDesiredStateConfiguration;

Node $AllNodes.NodeName {

# copy installers

File vSphereClient55
{
SourcePath = “\\DSC_APPS\VMware-viclient-all-5.5.0-2996327.exe”
DestinationPath = “c:\temp\VMware-viclient-all-5.5.0-2996327.exe”
Type = “File”
Ensure = “Present”
}

File NotePadPlusPlus
{
SourcePath = “\\DSC_APPS\npp.6.8.6.Installer.exe”
DestinationPath = “c:\temp\npp.6.8.6.Installer.exe”
Type = “File”
Ensure = “Present”
}

File PowerCLI60
{
SourcePath = “\\DSC_APPS\VMware-PowerCLI-6.0.0-3205540.exe”
DestinationPath = “c:\temp\VMware-PowerCLI-6.0.0-3205540.exe”
Type = “File”
Ensure = “Present”
}

File WinRAR
{
SourcePath = “\\DSC_APPS\winrar-x64-521.exe”
DestinationPath = “c:\temp\winrar-x64-521.exe”
Type = “File”
Ensure = “Present”
}

File WireShark
{
SourcePath = “\\DSC_APPS\Wireshark-win64-1.12.8.exe”
DestinationPath = “c:\temp\Wireshark-win64-1.12.8.exe”
Type = “File”
Ensure = “Present”
}

Package vSphereClient55 {
Ensure = “Present”
Name = “vSphereClient55”
Path = “c:\temp\VMware-viclient-all-5.5.0-2996327.exe”
ProductId = ”
Arguments = ‘/b”C:\Windows\Temp\PerforceClient” /S /V”/qn ALLUSERS=1 REBOOT=ReallySuppress”‘ # args for silent mode
}

Package NotePadPlusPlus {
Ensure = “Present”
Name = “NotePadPlusPlus”
Path = “c:\temp\npp.6.8.6.Installer.exe”
ProductId = ”
Arguments = ‘/b”C:\Windows\Temp\PerforceClient” /S /V”/qn ALLUSERS=1 REBOOT=ReallySuppress”‘ # args for silent mode
}

Package PowerCLI60 {
Ensure = “Present”
Name = “PowerCLI60”
Path = “c:\temp\VMware-PowerCLI-6.0.0-3205540.exe”
ProductId = ”
Arguments = ‘/b”C:\Windows\Temp\PerforceClient” /S /V”/qn ALLUSERS=1 REBOOT=ReallySuppress”‘ # args for silent mode
}

Package WinRAR {
Ensure = “Present”
Name = “WinRAR”
Path = “c:\temp\winrar-x64-521.exe”
ProductId = ”
Arguments = ‘/b”C:\Windows\Temp\PerforceClient” /S /V”/qn ALLUSERS=1 REBOOT=ReallySuppress”‘ # args for silent mode
}

Package WireShark {
Ensure = “Present”
Name = “WireShark”
Path = “c:\temp\Wireshark-win64-1.12.8.exe”
ProductId = ”
Arguments = ‘/b”C:\Windows\Temp\PerforceClient” /S /V”/qn ALLUSERS=1 REBOOT=ReallySuppress”‘ # args for silent mode
}
}
}
AllAdminServers_Software -ConfigurationData $ConfigData

Push Software Config

Start-DscConfiguration –Wait –Verbose -Force –Path .\AllAdminServers_Software

LINKS:

http://www.scconfigmgr.com/2014/08/22/how-to-get-msi-file-information-with-powershell/

http://foxdeploy.com/2014/03/10/desired-state-configuration-what-it-is-and-why-you-should-care/

http://jacob.ludriks.com/installing-pydio-through-powershell-dsc/

https://www.packtpub.com/networking-and-servers/learning-powershell-dsc

http://www.microsoft.com/en-us/download/details.aspx?id=48729

https://technet.microsoft.com/en-us/magazine/ff700227.aspx


Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.