Archive for the ‘Windows Server’ Category

Storage Spaces–Retiring an old disk (Simple parity volumes)

September 8, 2019 Leave a comment

If you are using HyperV and storage spaces, you will encounter an issue where there is no simple way to retire any volume


In this case, i’m trying to retire the older 50GB virtual disks for the larger 100GBs one.

To do so, i first declare a variable to hold the disk i want to retire in by selecting the first disk that is <50GB

$theDisk = Get-PhysicalDisk | ? Size -lt 51GB | Select-Object -first 1

Thereafter, to retire the disk, run the following command

Set-PhysicalDisk -Usage Retired -InputObject $theDisk

and verify it by running Get-PhysicalDisk again


Once the disk is marked as Retired, you can run the Repair Job, in this case i’m rebuilding the DB virtual Disk

Repair-VirtualDisk -FriendlyName "DB Virtual Disk"


Once this is completed, you may then proceed to remove the disk from the storage pool

Enabling Search for Local Administrator Account in Windows Server 2016

November 2, 2016 Leave a comment

By default, Windows Server 2016 will severely limit the access rights of the local administrator account.

Here are the steps to promote the account so that you can use it as a normal account

Run gpedit.msc

Goto Computer Configuration > Administrative Template > Windows Components > Search

Set Allow Cortana to Disabled


Next goto Computer Configuration > Windows Settings > Security Settings > Local Policies > Security Options

Set User Account Control: Admin Approval Mode for the Built-in Administrator Account to Enabled


Now reset the machine and the local administrator will behave like a normal user account

Creating a Master, Slave, Slave Nameserver setup using Vesta Control Panel

July 14, 2015 5 comments

You can easily setup a master, slave DNS using Vesta CP with a single command line found at

However should you bring this to the next level and use it for your “enterprise” web hosting, there are a few things you need to do


You might be tempted to setup Vesta in the following way, where all the webhosts will sync to NS01 and then have NS01 sync the dns config over to NS02.


Unfortunately Vesta does not allow you to do this, BUT it does allow the setup as shown below, where each of the web servers will send the dns updates to each of the named servers.



Setting up the NameServers (NS01, NS02)

Now given that Vesta will install and setup different components depending on the amount of ram of the machine, for NS01 and NS02, it would be wise to go with 512MB ram so that it will install the bare minimum.

Once you have installed Vesta on the servers, its time for some clean up

  1. Delete the unused packages
  2. cd $VESTA/bin
    ./v-delete-user-package palegreen
    ./v-delete-user-package gainsboro
    ./v-delete-user-package slategrey

  3. Create the dns-cluster user, who will own all the domains that was synchronized over

    ./v-add-user dns-cluster [password] [email] default [firstname] [lastname]

  4. Stop all the unnecessary services

    ./v-stop-service httpd
    ./v-stop-service nginx
    ./v-stop-service exim
    ./v-stop-service dovecot
    ./v-stop-service vsftpd

  5. Login to Vesta using your web browser, and disable the necessary services at the Firewall section
    1. Accepted services: SSH, DNS, Vesta, Ping
    2. Blocked services: Web, FTP, SMTP, POP3, IMAP, DB

Setting up the Master > Slave DNS (Web01, Web02 > NS01, NS02)

Remember that Vesta allows you to add an unlimited number of slave DNS for each master server

So for web01, and web02, run the following commands:

cd $VESTA/bin
./v-add-remote-dns-host ns01 8083 admin [ns01 admin password]
./v-add-remote-dns-host ns02 8083 admin [ns02 admin password]


You can verify that this is done by doing to server setup and ensuring that DNS is set to cluster and confirm that the following cron job exists



Testing the setup

Now goto web01 and/or web02 and create a few domains, on ANY accounts and at for the 6th minute of the hour, goto ns01 and ns02 to confirm that the changes are synchronized


Now what about URGENT cases

If there are cases where you urgently need to sync over, you can run this command on all of your web servers for each named server that you have: v-sync-dns-cluster [target host]

v-sync-dns-cluster ns01
v-sync-dns-cluster ns02

Categories: HyperV, Vesta

Installing CentOS 6.6 on HyperV 2012R2

July 11, 2015 Leave a comment
  • Download CentOS ISO file: You can download the latest version of CentOS at
  • Setup a HyperV VM for CentOS
    • At least 1 CPU
    • The amount of RAM will affect the installation GUI, VM with too little RAM will be reduced to a DOS like setup guide, whereas those with higher RAM will get a nice fancy GUI
    • No need for legacy network drivers, you can use the new 10GB network adapters normally used by HyperV
    • A minimum of 20GB HDD
    • Follow the guides and screen caps below if you need a detailed step by step guide
  • Once the OS is installed successfully, reboot
  • Login using the root account that was created during the installation
  • Issue the following 2 commands (these 2 commands are very important, failure to do this can result in unexplained hanging of the VM) 

    yum -y install hyperv-daemons
    yum -y update

  • If you wish for your installation to auto check for updates every night, issue the following commands

    #install yum cron job
    yum -y install yum-cron

    #enable nightly update
    /etc/init.d/yum-cron start

    #Enable at boot time
    chkconfig yum-cron on

Congrats, you now have a working CentOS in HyperV that auto updates itself every night to always be on the safe side of security 🙂

Setup in a Low Ram Environment

If you are running in a low ram environment, CentOS will not load the GUI setup environment, and you have to content with DOS based screens.

  1. Typically I would skip the media test since this is from an ISO file, if you are doing this off a DVD, might be wise to check, but be prepared to wait
  2. Then you will be prompted to setup a root password
  3. Once done, its now time to setup the disk. For convenience, I usually go for replacing the entire drive (its empty anyway)
  4. Simple matter of clicking write changes to disk to commit those changes
  5. Sit back and wait for installation to complete


Setup in a High Ram Environment

  1. Things look different if you have enough RAM, you get treated to a nice GUI
  2. Start by choosing your country and language
  3. You will then need to format the disk attached to the VM
  4. There after, setup the hostname
  5. As well as the networking details
  6. Then its onto the date/time settings
  7. And the root password
  8. Disk layout
  9. Confirmation of disk layout
  10. Type of installation, if you are going to install Vesta Control Panel, choose minimal
  11. Now sit back and wait for the installation to complete
Categories: HyperV

Running Bitnami LAMP stack in HyperV

September 21, 2014 1 comment

Bitnami has several nice prebuilt linux machines that is very useful for quick deploy.


In order to make it easier, you just need to setup a base image for the Bitnami LAMP stack VM


Download these first

Bitnami LAMP Stack: Goto and grab the vmware virtual machine image

Microsoft Virtual Machine Converter Solution Accelerator 2.0: Goto and grab the msi file


Convert VMDK to VHD

Run an administrative powershell instance and run the following 2 commands

# Import the MVMC cmdlets
Import-Module ‘C:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1’


#Convert the VMDK to VHDX

ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath bitnami-lampstack-5.4.32-0-ubuntu-14.04.vmdk -DestinationLiteralPath bitnami-lampstack-5.4.32-0-ubuntu-14.04.vhdx -VhdType DynamicHardDisk -VhdFormat Vhdx


Once the conversion is complete, use the HyperV –> Edit Disk function to compact the VHDX to save space

Create HyperV VM

Once done, just create a normal VM, there is no need to restrict yourself to the legacy network adapters, the new one works fine




Setting up your bitnami VM

Follow the guide found at


You can also refer to for some of the more administrative functions


Updating Integration Services

Issue the following command: sudo pico /etc/initramfs-tools/modules


Add these 4 items to the end of the file



Now rebuild the boot image

sudo update-initramfs –u


The guest OS needs to be rebooted:

sudo shutdown -r now

After the virtual machine reboots, run the following command to check if the modules are enabled:



Categories: HyperV

Windows Server Storage Spaces–Auto attach disk

May 8, 2014 Leave a comment

Sometimes when you reformat a server, the volume in the storage spaces is not auto attached.


to set it to automatically load use the following powershell

Set-VirtualDisk -FriendlyName Mirror -IsManualAttach 0

Categories: Windows Server

Disabling/Removing IIS Shared Configuration

March 1, 2014 Leave a comment


If you are using IIS Shared Configuration and changed the password for the account accessing the file path, you might encounter the following error

The World Wide Web Publishing Service service depends on the Windows Process Activation Service service which failed to start because of the following error:
The user name or password is incorrect.

The Windows Process Activation Service service terminated with the following error:
The user name or password is incorrect.

Windows Process Activation Service (WAS) is stopping because it encountered an error. The data field contains the error number.


Internet Information Services (IIS) Manager will also start with a weird error message and then prompts you to login


All these points to an inability to access the shared configuration


How to resolve?


  1. Stop IIS (iisreset /stop)
  2. Goto C:\Windows\System32\inetsrv\config
  3. Open redirection.config inside notepad
  4. Change the <configurationRedirection> part to <configurationRedirection />
  5. Start IIS again (iisreset)
Categories: IIS, Windows Server