Welcome to the blog of mechanised.com

This blog is mainly a technical repository of information on Virtualisation tools and management for our hosting service.

Also for HP's Bladesystem that we use at both our datacentres.

Other articles are also included on .Net development and MS SQL Server as well as other interesting things we come across.

Saturday, 26 May 2018

Using apex.run with cli53 AWS credentials without error

Using the cli53 command from https://github.com/barnybug/cli53 caused a slight issue with AWS credentials. We were seeing:

Error: NoCredentialProviders: no valid providers in chain. Deprecated. For verbose messaging see aws.Config.CredentialsChainVerboseErrors

This was due to no credentials file in ~/.aws/ even though the config file there had the credentials in it. Easy fix is to copy the config file to credentials

Tuesday, 22 May 2018

Create certificate from root CA

On a root CA with a standard CSR from another webserver to create the crt file enter the following command at elevated command prompt:

certreq -submit -attrib "CertificateTemplate:Webserver" .\CSR.txt

Tuesday, 13 March 2018

Server core 2016 handy commands

Setting up new server with core (no GUI) handy commands for setting up:

1) Setting static IP (using sconfig) - unbinding components not needed (everything except IPv4)

Listing current bound components:
PS> Get-NetAdapterBinding -InterfaceAlias Ethernet

Disable with the following commands:
PS> Disable-NetAdapterBinding -InterfaceAlias "Ethernet" -ComponentID XXXXX

2) Create extra drives for data/SQL server etc.

Change current CDROM drive letter
DISKPART> list volume
DISKPART> select volume 0
DISKPART> assign letter=F

Create drive for SQL data/log files etc.
Use Get-Disk first to see the drive numbers
Get-Disk -Number 1 | Initialize-Disk -PartitionStyle MBR -PassThru | New-Partition -UseMaximumSize -DriveLetter D | Format-Volume -FileSystem NTFS -NewFileSystemLabel "DATA" -AllocationUnitSize 65536

Get-Disk -Number 2 | Initialize-Disk -PartitionStyle MBR -PassThru | New-Partition -UseMaximumSize -DriveLetter E | Format-Volume -FileSystem NTFS -NewFileSystemLabel "LOG" -AllocationUnitSize 65536

If installing SQL Server, this must be done on command line as the GUI doesn't work.

3) When protected by additional firewall, turn off Windows local firewall:
Get-NetFirewallProfile | Set-NetFirewallProfile -enabled false

Check you can access the server remotely for settings you need to change etc. using Server Manager from another machine.

Change the port that SQL Server is listening on, as you can't use SQL Server Configuration Manager, run SQL Powershell from: C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\SQLPS.exe
Then run these commands:
$MachineObject = new-object ('Microsoft.SqlServer.Management.Smo.WMI.ManagedComputer') .
$ProtocolUri = "ManagedComputer[@Name='" + (get-item env:computername).Value + "']/ServerInstance[@Name='SQL2016']/ServerProtocol"
$tcp = $MachineObject.getsmoobject($ProtocolUri + "[@Name='Tcp']")
$MachineObject.getsmoobject($tcp.urn.Value + "/IPAddress[@Name='IPAll']").IPAddressProperties[1].Value = "1437"

Stop and restart the SQL Service and then you can connect with SSMS on a remote machine to the new port:
net stop MSSQL$SQL2016
net start MSSQL$SQL2016

Friday, 2 March 2018

"maximum consolidate retries was exceeded for scsix:x" error in ESXi (2082886)

If disk consolidation retries are exceeded, try this KB article. Use the PowerCLI command, seems to do the trick.


Wednesday, 26 July 2017

Connection limit reached in Windows Server

Windows server allows only 16384 connections to be open, if you need the maximum then run this:

netsh int ipv4 set dynamicport tcp start=1025 num=64510

To check this has worked correctly run this:

netsh int ipv4 show dynamicport tcp

Tuesday, 15 November 2016

Server core - assign static IPs on command line

First determine your interface names for multiple NICs:

netsh int ipv4 show interfaces

Next assign IP details to the interface name you require:

netsh interface ip set address "Ethernet1" static
netsh interface ip set dns "Ethernet1" static
netsh interface ip add dns "Ethernet1" index=2

Thursday, 3 November 2016

Removing Hyper-V role from Server 2012 R2 free edition

In powershell run this:

Remove-WindowsFeature -Name Hyper-V

This will then allow the free Starwind license to be installed on this free version of Windows as the role isn't recognised anymore.

Tuesday, 31 March 2015

Installing VMWare tools on RHEL6

Install the latest repo RPM for your version of vSphere:
Find the RHEL version and 32/64 bit RPM you need and grab the link, then install with YUM:
yum install http://packages.vmware.com/tools/esx/5.5latest/repos/vmware-tools-repo-RHEL6-9.4.11-1.el6.x86_64.rpm
Install the tools for non-graphical systems
yum install vmware-tools-esx-nox
It should show up pretty quickly within the client.

Friday, 9 January 2015

vCentre tidying of SQL

A few handy queries to tidy up old records to keep the database size down.

delete from vpx_text_array
where not exists(select 1 from vpx_entity where id=vpx_text_array.mo_id);

This removes old information about operations involving entities that don't exist anymore.

Friday, 26 September 2014

Fixing orphaned jobs left on source server for DoubleTake Availability


Removing old jobs from .dat and .xml files from here:

C:\Program Files\Vision Solutions\Double-Take\Service\Data

Restarting service on source and force full mirror on VRA.