Explorations within AWS – Setting ACLs on temporary SSD store for SQL

I have been quite busy lately and not had the time to update the blog so much that I wanted but I will try to add some posts during the summer!

In the project I am right now we are setting up environments in Amazons cloud AWS. I have used their images AMI for a SQL Always On cluster that spans over two nodes.

The AMI is preinstalled with SQL and ready for incorporation in an domain and the Enterprise version can be used with the r3.2xlarge r3.4xlarge and r3.8xlarge.

Screen Shot 2016-07-15 at 23.01.47

As you can see each of them have an SSD instance storage that can be used as a temporary volume which suits SQL tempdb perfectly. Just go into the SQL configuration and point its tempdb to the temporary storage! The MSSQL service account is a domain account without administrative rights on the server so that is why I explicit set the rights for the volume…

As the AWS documentations clearly tells us:

An instance store provides temporary block-level storage for your instance. This storage is located on disks that are physically attached to the host computer. Instance store is ideal for temporary storage of information that changes frequently, such as buffers, caches, scratch data, and other temporary content

You can specify instance store volumes for an instance only when you launch it. The data in an instance store persists only during the lifetime of its associated instance. If an instance reboots (intentionally or unintentionally), data in the instance store persists. However, data in the instance store is lost under the following circumstances:

  • The underlying disk drive fails
  • The instance stops
  • The instance terminates

So I created a small powershell script that runs each time the instance boots to set ACL´s on that volume for the SQL to be able to create its tempdb files. No tempdb files = no sql service running….

And this is set up as a powershell job that triggers on the server booting

Happy AWS´ing!

Add Chocolatey to my PackageManagement in Windows 10

I wanted to install the different browsers and also ChefDK on an new Windows 10 client and that with PowerShell. There is of course a way to just run Chocolatey command line but I wanted to use the PackageManagement so I had to add that provider and source so I could just use the Install-Package cmdlet.

I have a Windows 10 1511 with latest patches and I run the following commands to enable the chocolatey repository:

Screen Shot 2016-04-11 at 14.21.17

As you can see, when I enter Find-PackageProvider I find the Chocolatey provider and just run the Install-PackageProvider -Name Chocolatey

Screen Shot 2016-04-11 at 14.25.20

Then I need to open a new PowerShell window and can see that the PackageProvider and PackageSource have the Chocolatey records and thus I can now add software from this,

Screen Shot 2016-04-11 at 14.50.35

First I add Firefox and as you can see my PackageSource is not trusted and I get an warning, that can be configured with the Set-PackageSource -Name chocolatey -Trusted

Screen Shot 2016-04-11 at 14.53.06

Have fun with your package management 🙂

updated AzureRM PowerShell Module with Export of Resource Group

Today the version 1.3.0 of AzureRM module was released and in that there was a new cmdlet Export-AzureRMResourceGroup that can be used on an resource group and get a json file from that!

updating your AzureRM is quite easy with the powershell gallery repository

Screen Shot 2016-03-30 at 12.13.19

And then you can run the Export cmdlet and get the json file from that deployment and start playing in Visual Studio or VS Code 🙂

Screen Shot 2016-03-30 at 11.43.21

Have fun automating and deploying with Azure Resource Manager!

powershell env:PSModulepath duplicate records Winserv 2016 TP4

I was testing some xAzure DSC configuration stuff on my Windows Server 2016 TP4 and noticed that when I was trying to use the resource it said that duplicate modules was found but I could not find any in the powershell module libraries and thus it ought to be something else,

I found the tweet that Ben Gelens sent pointing me to the $env:psmodulepath

Screen Shot 2016-03-23 at 22.02.29

So looking in my psmodulepath I could see that I had two records that was the same and that had to be fixed,

Screen Shot 2016-03-23 at 14.48.58

So to remove the duplicate I first remove both and then add the one again:

Screen Shot 2016-03-23 at 14.49.52

$env:PSModulePath = $env:PSModulePath –replace “;C:\\Program Files\\WindowsPowerShell\\Modules”

Screen Shot 2016-03-23 at 14.52.54

$env:PSModulePath = $env:PSModulePath + “;C:\Program Files\WindowsPowerShell\Modules”

Happy automating 🙂

Download SysCtr 2016 TP4 VHD´s with PowerShell

I have been using and publishing my script for easily download all the VHD´s for evaluating and testing the technical previews of System Center 2016 and now it is time for the TP4! These pre-installed VHD´s make it quite easy to spin up some of the System Center Suite as VM´s on your Hyper-V box within minutes once downloaded.

Here is the script for your convenience and start playing with the new release!

 

 

Managing Azure workloads with Chef and PowerShell DSC at TechDays

pic-devops-kungfu

Last week at TechDays me self and Fredrik Nilsson had a session about managing your workloads in Azure with Chef and PowerShell DSC. Despite the fact that we had the same timeslot as Arwidmark, Nystrom and Ben Armstrong our room was quite full of kung fu interested geeks 😉

Here is the presentation so you can find the links and info:

Screen Shot 2015-10-26 at 10.34.23

TechDaysChefAzure

For you guys that did not have the opportunity to be there, a recording will be available although it is in Swedish…

Playing with automation of OMS agent deployment

I have been playing around with automation of the deployment of OMS agents in my lab environment and wanted to share one way to do it, of course there are others.

I found Adam´s contribution to send files over PS2+ WinRM instead of utilizing a remote share or other deployment of the installation file..  Sometimes you maybe have firewall constraints to take into consideration and then this is a handy way to get that MMAgent over and installed if you have maybe only PowerShell remoting open 🙂

If you already have WMF 5 deployed you can utilize that instead of the Send-File function as it is in the new PowerShell version by default.

Screen Shot 2015-10-13 at 21.40.01

And here is the code:

good luck in deploying those OMS agents!

 

My Community PowerShell Jewels session on PowerShell Summit (links)

TechDays Session: Managing your Azure workloads with Chef and PS DSC

Are you possibly going to the TechDays Sweden this autumn ? Me self and my friend and former colleague Fredrik Nilsson will have a session on this conference about automation and how to use Chef and PowerShell DSC for your deployment.

Screen Shot 2015-06-24 at 10.20.32
This session will focus on how Chef, a systems and cloud infrastructure automation framework, can manage both Windows and Linux workloads on Azure or any physical, virtual location no matter the size of the infrastructure easily.

We will also look at how Chef can interact with PowerShell Desired State Configuration to deliver a consistent and compliant infrastructure. In this session you will learn the basic paradigms of Chef, launching VM instances and deploying applications to these instances. It is DevOps times now with a faster and agile world where the IT-Dinosaurs will have to watch out!