Archive for February, 2017

Installing vCenter for ESXi 6.0

Posted: February 22, 2017 in VMWare

In this post i’ll install vCenter on Windows Server 2016 with SQL database located on separate server.

vCenter Server is an application that is used as a centralized management tool for ESXi hosts and  VMs. vCenter Server performs tasks on the individual ESXi hosts that have been added as members of a vCenter

vCenter server must have at least 8 GB of RAM

Configuring SQL server

I’ll use Windows authentication,so first step would be to create login and map it to Windows user account (standard domain user)

In SQL management studio Expand Security-Right click Login-New Login




Check Windows authentication-Search



Location-domain name-enter domain user name (esxi_user in my case)




Creating database

vCenter needs database for storing it’s data.Right click database-New database



Specify new login as database owner




Set this login as owner of msdb database but only during vCenter installation,after installation finishes,restore sa account as msdb owner





Setting vCenter server

vCenter server needs to have access to SQL server database during installation


Download and install SQL native client from (sqlncli.msi)




Control Panel-Administrative tools-ODBC Data Sources (64-bit)




Select System DSN-Add-SQL Server Native Client-Finish



After clicking Finish,Create a New Data Source wizard opens-set name,from drop-down list choose SQL server and click Next



Check Integrated Windows authentication and click Next



Click Change the default database to: and from drop-down list select database for vCenter and click Next




Click Test data source and if everything is fine,click OK



Installing vCenter (NET Framework 3.5 is required)




The Platform Services Controller (PSC) enables  log in and administer vCenter,so it must be installed



Set System name



Set password for SSO administrator




Service account must be specified if we want to use Windows authentication







We must add System account Log on as service right,on Domain controller create/edit GPO

Windows Settings-Security Settings-Local Policies-User Right Assignment-Log on as a service-Add account




on vCenter server run gpudate /force and click next,error should disappear-click Next

Select DSN Name (created in previous steps)













After installation we can see that setup created a bunch of tables for databases








Unattended install ESXi 6.0

Posted: February 21, 2017 in VMWare

Creating ks.cfg file

This specify install location,root password,network settings and hostname

# Sample scripted installation file
# Accept the VMware End User License Agreement
# Set the root password for the DCUI and Tech Support Mode
rootpw mypassword
# Install on the first local disk available on machine
install --firstdisk=local --overwritevmfs
# Set the network to static on the first network adapter
network --bootproto=static --device=vmnic0 --ip= --netmask= --gateway= --nameserver=
# A sample post-install script
%post --interpreter=python --ignorefailure=true
import time
stampFile = open('/finished.stamp', mode='w')
stampFile.write( time.asctime() )

I copied this file to USB stick (must be formatted as FAT32!!)

We need to specify path to unattended file (Shift+O)



ks=usb (specifies usb as ks.cfg file location-installer will search for all USB drives formated as FAT16/32)



Installation has finished:



In one of my previous posts i installed nano server.Now we’ll deploy Windows container to Nano server.

A container is an isolated place where an application can run without affecting the rest of the system, and without the system affecting the application.Container shares OS kernel so it can be seen as “isolated” part of guest OS.

Windows Containers include two different container types

Windows Server Containers – A Windows Server container shares a kernel with the container host and all containers running on the host.

Hyper-V Containers – expand on the isolation provided by Windows Server Containers by running each container in a Hyper-V virtual machine. In this configuration the kernel of the container host is not shared with other Hyper-V Containers.

Connecting to Nano Server

Set-Item WSMan:\localhost\Client\TrustedHosts -Force
Enter-PSSession -ComputerName -Credential Administrator

Updating Nano Server

#Scan for updates

$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession
$result = $ci | Invoke-CimMethod -MethodName ScanForUpdates -Arguments @{SearchCriteria="IsInstalled=0";OnlineScan=$true}

# Install all updates

$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession
Invoke-CimMethod -InputObject $ci -MethodName ApplyApplicableUpdates


# List Installed Updates

$ci = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession
$result = $ci | Invoke-CimMethod -MethodName ScanForUpdates -Arguments @{SearchCriteria="IsInstalled=1";OnlineScan=$true}

Installing Container

#Install the OneGet PowerShell module,it's container provider

Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
#Use OneGet to install the latest version of Docker.
Install-Package -Name docker -ProviderName DockerMsftProvider


Afrer rebooting start Docker service and install base image

Start-Service docker
docker pull microsoft/nanoserver

Enabling remote access to docker host (Nano Server)

netsh advfirewall firewall add rule name="Docker daemon " dir=in action=allow protocol=TCP localport=2375
Stop-Service docker
dockerd --unregister-service
dockerd -H npipe:// -H --register-service
Start-Service docker

Connecting to Windows container from remote computer

#Download docker client
Invoke-WebRequest "" -OutFile "$env:TEMP\" -UseBasicParsing

#extract it
Expand-Archive -Path "$env:TEMP\" -DestinationPath $env:ProgramFiles

# For quick use, does not require shell to be restarted.
$env:path += ";c:\program files\docker"

# add docker directory to system path
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\Docker", [EnvironmentVariableTarget]::Machine)

Connect to docker container hosted on Nano Server (,this command will create container from microsoft/nanoserver image with name nano and container hostname nano

docker -H tcp:// run -it --name nano --hostname nano microsoft/nanoserver cmd


The goal of Storage Spaces is to create highly available storage solution that has all the advantages of SAN (power and flexibility),but is significantly cheaper.Storage spaces “virtualizes” storage (which consist of HDD and SSD.A storage pool is a container that is used to group physical disks (mixing SSD and HDD).It provides the ability to store more frequently accessed data on SSD media,with both types of media used as block based storage for the same virtual disk: the best of both types of storage

In this lab i used machine VMWare workstation VM with 4 HDD and 2 SSD disks (each with 10 GB)

To simulate SSD disk in VMWare,we need to edit virtual machine’s vmx file

scsix:y.virtualSSD=1,where x:y is scsi disk number


Check VM configuration:

Get-PhysicalDisk -CanPool $true | sort size |ft deviceid,friendlyname,canpool,size,mediatype -AutoSize


As we can see,non-SSD disks are specified as “unspecified”,we need to set its media type as HDD,in order to avoid errors

Get-PhysicalDisk | where MediaType -EQ unspecified | where Size -LT 60GB | Set-PhysicalDisk -MediaType HDD

i used filter to exclude system disk (60 GB) because that disk won’t be member of storage pool

Get-PhysicalDisk | sort size |ft deviceid,friendlyname,canpool,size,mediatype -AutoSize


Create storage pool

New-StoragePool -StorageSubSystemUniqueId $pool.UniqueId -FriendlyName mypool -PhysicalDisks (Get-PhysicalDisk -CanPool $true)


Get-StoragePool mypool | Get-PhysicalDisk | ft FriendlyName,MediaType,Size


Configuring Tiers

As we mentioned before,we need to create storage tiers to group SSD and HDD media types

Get-StoragePool mypool | New-StorageTier –FriendlyName HDDTier –MediaType HDD
Get-StoragePool mypool | New-StorageTier -FriendlyName SSDTier -MediaType SSD

Get Pool capacity

Get-StoragePool mypool | fl Size,AllocatedSize


Storage Spaces reserves 256 MB for each disk (6×256=1,5 GB)

Get Tier capacity

HDD tier (mirror):

Get-StorageTierSupportedSize hddtier -ResiliencySettingName mirror | ft -AutoSize


If we want to use tier in “mirror” mode,maximum space is 8 GB (10+10)/2

SSD tier 

Get-StorageTierSupportedSize ssdtier -ResiliencySettingName mirror | ft -AutoSize


Maximum free space is 16 GB

Configuring resilency settings

Storage Spaces offers increased performance by striping data across multiple disks,these disks are named NumberOfColumns.NumberOfDataCopiesDefault parameter specifies on how many disks data will be stripped across

Get-StoragePool mypool | Set-ResiliencySetting -Name mirror -NumberOfDataCopiesDefault 2

 Creating mirrored spaces with tiering

$ssd=Get-StorageTier -FriendlyName ssdtier
$hdd=Get-StorageTier -FriendlyName hddtier
Get-StoragePool mypool | New-VirtualDisk -FriendlyName space1 -ResiliencySettingName mirror -StorageTiers $ssd,$hdd -StorageTierSizes 16gb,8gb -WriteCacheSize 1gb
Get-VirtualDisk | ft -AutoSize


Creating Partition and Volume

Get-VirtualDisk Space1 | Get-Disk | Set-Disk -IsReadOnly 0
Get-VirtualDisk Space1 | Get-Disk | Set-Disk -IsOffline 0
Get-VirtualDisk Space1 | Get-Disk | Initialize-Disk -PartitionStyle GPT
Get-VirtualDisk Space1 | Get-Disk | New-Partition -DriveLetter "F" -UseMaximumSize
Initialize-Volume -DriveLetter “F” -FileSystem NTFS -Confirm:$false


Upgrading SCCM 1606 to 1610

Posted: February 10, 2017 in SCCM

For full features of 1610 take a look at technet link.

Before performing upgrade,go to upgrade check-list and perform site backup

Upgrade is done using console only (no download link)


Downloading update

Administration-Cloud Services-Updates and Services-Check for updates



You should see 1610 update in the console in “Downloading” state (Check C:\Program Files\Microsoft Configuration Manager\Logs\dmpdownloader.log for status)





Update files are downloaded to \Microsoft Configuration Manager\EasySetupPayload folder



We can aslo monitor download status using Resource Manager




Prerequisite check


After download,status is changed to “Available”-right click to update-Run Prerequisite check



Status can be tracked from C:\ConfigMgrPrereq.log



Or Monitoring-Distribution Status-Updates and Servicing Status-Right click on update-Show status






Starting update


After prerequisite steps are completed,perform actual installation by right clicking on update-Install update pack














For installation status,again log file C:\Program Files\Microsoft Configuration Manager\Logs\CMUpdate.log or  Monitoring-Distribution Status-Updates and Servicing Status-Right click on update-Show status





Installation has finished




Upgrading Console

After console is reopened we’ll be asked for console upgrade



For progress take a look at C:\ConfigMgrAdminUISetup.log and C:\ConfigMgrAdminUISetupVerbose.log

Checking version




Administration-Site Configuration-Sites-Right click site-General



Client package update check

Software Library-Application Management-Packages-Check Last Update Date for Client Packages,it it’s “out-of-date”,right click on package-Distribute Content-select DP and click finish






Updating Boot images

Check update time



If it’s not close to current time,right click image-Distribute Content



Select Distribution Point






Upgrading Configuration Management Client

Administration-Site Configuration-Sites-Select site and click Hierarchy settings



Click on Client Upgrade tab-check Upgrase all clients check-box,optionally set time frame



In this article we’ll install Ubuntu Server 16.04.01 as Hyper-V VM with 2 CPU’s,1 GB of RAM and 20 GB HDD (Note machine is Generation 1,with Gen 2 it didn’t work for me)

new-vm -Name 'ubuntu' -MemoryStartupBytes 512MB -NewVHDPath 'c:\ubuntu\ubuntu.vhd' -SwitchName 'new virtual switch' -NewVHDSizeBytes 20GB -Generation 1 -MaximumBytes 2GB
set-vm -VMName 'ubuntu' -ProcessorCount 2
Get-VM -Name 'ubuntu' | Add-VMDvdDrive
Set-VMDvdDrive -VMName 'ubuntu' -Path 'C:\Users\dragan\Downloads\ubuntu-16.04.1-server-amd64.iso'





Enabling SSH access on Ubuntu

I don’t know for you,but it’s very uncomfortable to work from Hyper-V console,that’s why i prefer SSH access

apt-get install openssh-server -y
service sshd restart

Allow ssh traffic to your Ubuntu server (

ufw allow proto tcp from to port 22

Download and install Putty.You should be able now to make connection to Ubuntu Server via port 22



Installing integration services

Hyper-V Integration Services allow a virtual machine to communicate with the Hyper-V host .(Think of it as equivalent of VMWare tools).These services enables,for example,guest file copy, while others are important to the virtual machine’s ability to function correctly, such as time synchronization.

apt-get install --install-recommends linux-tools-virtual-lts-xenial linux-cloud-tools-virtual-lts-xenial linux-virtual-lts-xenial

Reboot the Ubuntu Server

If we want to copy files to VM we need to enable Guest Service interface (disabled by default)

On Hyper-V host check current status:

Get-VMIntegrationService -VMName 'ubuntu'



Enable-VMIntegrationService -VMname 'ubuntu' -Name 'guest service interface'

Copying file from Hyper-V host to Ubuntu VM:

echo 'This file is about to be copied to ubuntu server'>c:\file.txt
Copy-VMFile -name 'ubuntu' -SourcePath 'C:\file.txt' -DestinationPath '/root/' -FileSource Host