Sometimes you are gonna create a service principal on Azure Cloud that will manage some applications or automate some tasks. For example you might use a service principal to upload backups on Azure Storage. A service principal can be created with either password or a certificate but it has an expiration date by default. This means that in order to ensure that you can use your service principal and perform tasks you have assigned to it you have to change the password of certificate from time to time. I have created a simple script that uses azure-cli to check when the password or certificate expires. It can be executed via cron or a monit check and notify you.
I have been working on a new project where our VMs are hosted on Microsoft Azure cloud. The default OS disk size for most Linux distros in Azure is 30GB. We needed more space so instead of adding a new virtual disk I ‘ve found out that it is possible to expand the OS disk. When the VMs were initially launched they were launched with unmanaged disks.
You should have in mind that if you need to resize the OS disk that:
- You will need to stop the VM in order to resize the disk
- You can not shrink the disk once you had it expand. Disk size reduction is not supported
In the following example the disk of VM will be resized from 30GB to 300GB.
I was launching a couple of Ubuntu 14.04 KVM guests and I ve noticed that time was wrong. OK I thought, a simple ntpdate command and ntp service enabled will fix the issue. Made a reboot of the guest host and show that the time was ok. Then I destroyed the guest and when I checked the time it was wrong. This can’t be right, I thought, and started researching what might be the issue. What I found is that KVM guests should always consider their hardware clock in UTC time while my guests configuration was in local time.
When a browser send a request to an apache web server, apache will send back the response data as well as response headers. You can check what kind of headers are send back with curl command.
$ curl -I http://mysite/
or if the site is on https
$ curl -Ik https://mysite/
Date: Mon, 07 Dec 2015 10:12:52 GMT Server: Apache X-Powered-By: Phusion Passenger (mod_rails/mod_rack) X.X.XX Cache-Control: no-cache
As a mentioned in previous posts I have created a simple script that would clone/configure a KVM guest based on existing templates. The scripts can be found in my github https://github.com/mrdimka/kvm-scripts . When I tried to launch a CentOS 6 VM I ve noticed that eth0 was not configured and was failing.
It’s quite sometime since RHEL/CentOS 7 (2014-06-09) was released so a few days ago I thought I should try it out and maybe create a KVM Guest template in case I need it in the future.
I have been trying to create a simple bash script for copying/configuring KVM guests using templates.
This way I don’t need to do the whole installation over and over again.
The script would use an already KVM image file copy it to a new image file, mount it change the hostname and network settings. It would also copy the xml file remove the uuid, change its name and define it with virsh command.
I ve been using KVM for virtualization. Sometimes we need to resize our VM’s disk. We can either expand or shrink. Below I am going to describe how we can do it.
I have been using vagrant to develop chef cookbooks. Vagrant is a tool for managing virtualized development environments. When vagrant was initially launched supported VirtualBox only. As vagrant matured more providers were added like VMWare, AWS, Docker etc. I prefer using vagrant with its default provider, VirtualBox. I use vagrant 1.6.3 with ruby 1.9.3p547 on my Ubuntu 12.04 Lenovo U410 ultrabook.