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.
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
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
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
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
If installing SQL Server, this must be done on command line as the GUI doesn't work.
setup.exe /QS /ACTION=Install /FEATURES=SQL /INSTANCENAME=SQL2016 /TCPENABLED=1 /NPENABLED=1 /IACCEPTSQLSERVERLICENSETERMS=1 /UPDATEENABLED=True /SECURITYMODE=SQL /SAPWD="R@nd0mp4ssw0rd" /INSTALLSQLDATADIR=D:\DATA\ /SQLUSERDBDIR=D:\DATA\ /SQLUSERDBLOGDIR=E:\LOG\ /SQLCOLLATION="Latin1_General_CI_AS" /INDICATEPROGRESS /SQLSYSADMINACCOUNTS="Administrator"
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"
$tcp.alter()
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
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
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.
setup.exe /QS /ACTION=Install /FEATURES=SQL /INSTANCENAME=SQL2016 /TCPENABLED=1 /NPENABLED=1 /IACCEPTSQLSERVERLICENSETERMS=1 /UPDATEENABLED=True /SECURITYMODE=SQL /SAPWD="R@nd0mp4ssw0rd" /INSTALLSQLDATADIR=D:\DATA\ /SQLUSERDBDIR=D:\DATA\ /SQLUSERDBLOGDIR=E:\LOG\ /SQLCOLLATION="Latin1_General_CI_AS" /INDICATEPROGRESS /SQLSYSADMINACCOUNTS="Administrator"
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"
$tcp.alter()
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.
https://kb.vmware.com/s/article/2082886
https://kb.vmware.com/s/article/2082886