bottkars / Azurestack-Kickstart

streamline the post-deployment of Azure Stack ASDK
5 stars 2 forks source link

Azurestack-Kickstart

Azurestack Kickstart is an automation to AzureStack ASDK ( and Integrated Systems )
It is an automated Process to do initial Configurations, Management Tasks and deployments.
The Idea is to have base components/logins stored in a json template and credentials stored in session variables.

The Current Version assumes AzureStack ≥ 1807 and will deploy AzureRM Profile 2.40 and AzureStack Tools 1.5.0

Azurestack-Kickstart is tested against 1809 successfully
However, the behavior is set in your admin profile ( see below )
The Consistent Approach allws you to "Bootstrap" your Shell session with the 99_bootstrap script(s) The Bootstrap Scripts wll read the user / admin json files having envronment data stored from the Homedirectory

to install the Azure Stack Kickstart, simply type in

install-script azurestack-kickstart -Scope CurrentUser -Force
Azurestack-Kickstart.ps1

the command will run itsself in elevated Mode and will:

To update Kickstart or the Sub-Modules, just type

./update.ps1

from the kickstart root

Once finished, CD into Azurestack-Kickstart. run 01_asdk_post to

.\admin\01_asdk_post.ps1 -LanguageTag de-DE

create an admin.json file in your Homedirectory ( copy the admin.json.example fro the root of the distro as reference)

example admin.json

{
"DNSDomain" :"azurestack.external",
"Domain": "azurestack",
"location": "local",
"VMPassword": "Password123!",
"VMuser": "azureuser",
"TenantName": "contoso.onmicrosoft.com",
"subscriptionID": "8c21cadc-9e41-459e-bf4b-919aa2fad975",
"SubscriptionOwner": "Administrator@contoso.com", 
"PrivilegedEndpoint": "azs-ercs01.azurestack.local",
"serviceuser": "masadmin",
"cloudadmin": "cloudadmin",
"AZSTools_Location": "D:\\AzureStack-Tools",
"AzureRMVersion": "2.40",  //This set´s the profile to be installed
"AzureSTackModuleVersion": "1.5.0",  //this set´s the Azurestack Module Version to be installed
"SQLRPadmin": "SQLRPadmin",
"MySQLRPadmin": "MySQLRPadmin",
"SQLHost": "SQLHost1",
"MySQLHost": "MySQLHost1",
"ISOpath": "D:\\ISO",
"Updatepath": "D:\\Updates"
"consumptionSubscription": "Default Provider Subscription",
"meteringSubscription": "Default Provider Subscription"
}
}

initial powershell modules config

To set the initial stack configuration and install Powershell Modules run:

.\admin\03_initial_stack.ps1

The Command will run itself in elevated Mode ![image]image

this task can be repeated at any time to update the AzureStack Powershell environment

register the stack

.\admin\06_register_stack.ps1

this will use your setiings from admin.json to register your azurestack

Starting the customizations

we have to load now our admin environment and gegister our cloudadmin/serviceadmin user
this will store credentials in the session for avoiding multiple login requests

 .\admin\99_bootstrap.ps1

image
image

deploy Base Plans

.\admin\10_deploy_base_plans_and_quotas.ps1 

image

deploy Windows Marketplace Items from ISO

this needs to run in an Admin Session
first browse available KB Versions ...

get-content .\admin\windowsupdate.json | ConvertFrom-Json

then deploy ...

 .\admin\11_deploy_windows_marketplace_image.ps1 -KB KB4056890

image

you can create Bulk Marketplace Images by using:

$KB = (get-content .\admin\windowsupdate.json | ConvertFrom-Json | ConvertFrom-Json) | Sort-Object -Property Date | Select-Object KB -Last 5 | Where-Object KB -ne ""
$KB | .\admin\11_deploy_windows_marketplace_image.ps1 

this will batch create Marketplace Items for last 5 Windows Server 2016 KB´s listed in the included windowsupdate.json
the process is

Create SQL Server for PaaS, make sure to create SKU after 22 !

.\admin\20_deploy_sql_host.ps1
.\admin\21_deploy-sql-provider.ps1
# create sku
.\admin\22_deploy-sql-provider_hosting.ps1

Create MySQL Server for PaaS, make sure to create SKU after 26 !

.\admin\25_deploy-mysql-host.ps1
.\admin\26_deploy-mysql-provider.ps1
# creste sku
.\admin\27_deploy-mysql-hostingserver.ps1

PCF Deployment

there is a pcf deployment module for opsmanager including a deployment template.

follow PCF Deployment using Kickstart Template for further instructions

user scripts

example user.json file

{
"DNSDomain" :"azurestack.external",
"Domain": "azurestack",
"location": "local",
"VMuser": "azureuser",
"VMPassword": "Password123!",
"TenantName": "karstenbottemc.onmicrosoft.com",
"azsuser": "azsuser1",
"cloudadmin": "cloudadmin",
"AZSTools_Location": "D:\\AzureStack-Tools",
"AzureRMVersion": "2017-03-09-profile",
"AzureStackModuleVersion": "1.2.11",
"location": "local",
"StackIP": "10.204.16.82"
}

user bootstrapping

once the use has created his config file, he can bootstrap from his powershell to get permanent variables in the session.

.\user\99_bootstrap_user.ps1

image

creating Windows VM Scalesets using -osImageSkuVersion

If the Cloudadmin has provided differnt osImageSKU´s from above, we can

.\user\60_new-azsserver2016vmss.ps1 -vmssName myssdemo -osImageSkuVersion 14393.729.20170130

This creates a new vmscaleset with the os image version 14393.729.20170130
image

we can verify the properties of the scaleset :

image

Demo Videos:

Part 1: Part1

Part 2: Part2