Prevent the auto-termination of stranded instances in RighScale

When you launch an instance with RightScale Self Service, and the Chef cookbook execution fails, the instance goes into “stranded” mode. By default RightScale Self Service terminates the stranded instances, so there is no way to remote into them and read log files to find the cause of the problem. To keep stranded instances running in RightScale …

Getting started with InSpec

InSpec is an open-source testing framework to verify your infrastructure satisfies the design requirements. In this article, we will learn to install and use InSpec with Chef. Install InSpec Navigate to https://downloads.chef.io/inspec, and download the installer for the operating system of your workstation, Execute the downloaded installer. Allow InSpec to verify Red Hat Enterprise Linux instances InSpec needs …

Undefined method or attribute error in a Chef recipe

There are multiple reasons Chef can display the following error message NoMethodError ————- Undefined method or attribute `…’ on `node’   There are many ways to reference an attribute in a Chef recipe: node[‘ATTRIBUTE_NAME’] (the recommended style) node[“ATTRIBUTE_NAME”] node[:ATTRIBUTE_NAME] (use it only if the single or double quotes (‘ or “) would cause a problem …

Monitor timeouts in TeamCity

TeamCity is a Continuous Integration (CI) tool that enables software development teams to build and test their software. Sometimes the server is too busy to serve the users and the web user interface does not respond in time. TeamCity logs all actions in a log file so we can find the date and time of …

Native resolution in Remote Desktop client on MacOSX

When you connect to a Windows computer from your Macintosh workstation the best remote desktop client is the Microsoft Remote Desktop app from the Apple Appstore. To configure the remote desktop connection for the best experience Select Native resolution Scale content for Full screen mode To be able to unselect the “Use all monitors checkbox”, …

How to restore a Microsoft SQL database from backup with the Microsoft SQL Server Management Studio (MSSMS) user interface

There are multiple reasons to restore a database from backup. One of them can be disaster recovery, the other is to bring the production database to the developer machine. In both cases, the computer already has the old version of the database. In the new version of Microsoft SQL Server Management Studio (MSSMS) we cannot find …

Error waiting for instance (i-…) to become ready: unexpected state ‘terminated’, wanted target ‘running’

When you launch a server instance with Terraform, sometimes the error message does not contain the underlying cause. When the cloud provider cannot complete the request, many times Terraform displays a generic error message: Error waiting for instance (i-…) to become ready: unexpected state ‘terminated’, wanted target ‘running’ To find the root cause of the …

Upgrade a server on an AWS EC2 instance with minimum risk and downtime

When you need to upgrade an application on an AWS EC2 instance with minimum downtime, there are many options. Upgrade an EC2 instance Stop the application, so users don’t make more changes, Create a backup of the database (snapshot of the RDS instance), Create a backup of the server (backup image of the EC2 instance), …

Test your RightScale script without creating unnecessary revisions

There are certain functions in RightScale scripts (RightScripts) that you cannot test without launching a new instance. To test your script: Edit the Head revision of the RightScale script and save it, Attach the Head revision of the RightScale script to the Head revision of the RightScale Server Template, Select the Head revision of the …

Custom Git Status and Git Pull commands to work with all of your repositories

If you work with many Git repositories it is easy to miss a repository when you commit your changes, and very time consuming to pull from all repositories. It is easy to automate both processes. In this example, we will place all files in the ~/Git/devops-scripts folder. If you want to place your files at another …