Wednesday 31 October 2012

How to set up QoS bandwidth rate limit on Vyatta router

If you are running a network shared by multiple devices, you probably want to set up QoS policies (e.g., average bandwidth rate, burst size), so that network bandwidth is properly shared by them. Vyatta software router supports powerful QoS settings. You can easily define any QoS policy, and bind the policy to a specific network interface/port, or to specific types of traffic, etc.Read more »

Tuesday 30 October 2012

How to benchmark virtual machines

When you are comparing various hypervisors, you may want to compare the performance of virtual machines (VMs) running on different hypervisors. Also, if you are comparing various public cloud providers, you will want to benchmark VMs offered by available providers. Whatever the reason may be, it is useful to know how to benchmark VMs properly.Read more »

Monday 29 October 2012

How to check openvswitch version

Open vSwitch (OVS) is an open-source virtual switch, featuring programmable switch forwarding capability. The forwarding plane of OVS can be dynamically controlled by an external network controller, such as OpenFlow controller, which enables key innovation called software-defined networking in large-scale virtual environments.Read more »

Friday 26 October 2012

How to find a rogue DHCP server

If your company has a large corporate network shared by many employees, you may have encountered the case where your host machine is getting an IP address assigned by some unknown DHCP server not under the administrative control of the corporate network, which in turn causes various connectivity issues for your host. When a host machine is trying obtain an IP address via DHCP, it accepts whichever DHCP offer message arrives first. Hence, if a rogue DHCP server is interfering with a legitimate DHCP server by sending out DHCP offers of its own, it can cause various networking related problems for connected hosts by supplying them with unreachable default gateway, private IP addresses, bogus DNS resolver, etc.Read more »

Thursday 25 October 2012

How to find the IP address of a DHCP server

When a network interface set up for DHCP is being enabled, a host machine broadcasts DHCP discovery message to discover available DHCP servers on the network. Once the host has received a DHCP offer message from any DHCP server, it then sends a DHCP request message to the DHCP server to finalize the lease of an IP address.Read more »

Wednesday 24 October 2012

/etc/hosts vs. /etc/resolv.conf

When an application performs DNS lookup as part of its operations on Linux, it can leverage both /etc/hosts and /etc/resolv.conf configuration files to resolve DNS names. How these configuration files are used for DNS lookup can vary among different applications, complicating system administration. But Linux libc library and the GNU C Library (glibc) provides a clean solution to this problem, by defining DNS lookup orders with Name Service Switch (NSS). NSS defines a set of databases and their lookup order in NSS configuration file (/etc/nsswitch.conf in Linux). Applications built with those libraries will then perform DNS lookups in a consistent manner.Read more »

Tuesday 23 October 2012

How to set up QoS bandwidth rate limit on XenServer VM's network interfaces

In a multi-tenant VM environment, you would need to allocate network bandwidth appropriately to all existing tenants/VMs, such that no one can consume available network resources by himeself/herself. Even in a single-user environment, you may want to define QoS policies for your VM (such as per-interface bandwidth caps) for various reasons. If you are using XenServer as your hypervisor, XenServer actually allows you to rate limit outgoing traffic of VM's virtual interfaces. If you would like to set up QoS bandwidth rate limit on XenServer VM's network interfaces, follow the instructions here.Read more »

Monday 22 October 2012

How to backup a MySQL server

If you are running a MySQL server with critical information in its databases, you may want to back up the databases periodically. A Linux command-line tool called mysqldump allows you to back up MySQL databases without needing to shut down a MySQL server. mysqldump generates as output a text file containing a series of MySQL commands that represent a current snapshot of MySQL databases being backed up. The mysqldump output file can easily be compressed and/or encrypted as needed. The following is how to backup a MySQL server with mysqldump.Read more »

Friday 19 October 2012

How to apply a XenServer update patch

Citrix distributes patches or hotfixes of XenServer on a regular basis, for fixing bugs or updating security features. A XenServer patch may have dependency on other fixes, in which case you will fail to install the patch without applying all dependent fixes first. If you would like to apply a patch on your XenServer host, you can use either XenCenter client software or XenServer command line interface (CLI). Here I will focus on using XenServer CLI to install XenServer patches.Read more »

Thursday 18 October 2012

How to install OpenStack on multiple nodes

OpenStack is an open-source cloud management software that one can use to enable Infrastructure as a Service (IaaS) offerings. With major IT powerhouses such as HP, AT&T, IBM backing OpenStack, and a large pool of OpenStack developers contributing code to the project daily, OpenStack is fast becoming a de facto cloud standard. If you want to see OpenStack in action, it's a good idea to install it yourself on a small scale (preferrably at least two nodes).Read more »

Wednesday 17 October 2012

How to plot using specific rows of data file with Gnuplot

In many cases you probably want to filter a raw data file in various fashions before plotting the data with Gnuplot. In some cases, you may want to use only specific rows (e.g., from line 10 to 100) of a data file in your plot. With Gnuplot, you can specify a range of data to be plotted in two different ways.Read more »

Tuesday 16 October 2012

How to disable xsconsole autorun in XenServer

Although XenServer's management interface (i.e., xsconsole) is a security protection against XenServer getting tampered with by an unauthenticated user, auto-running xsconsole may be cumbersome for you in certain situations. For example, if you are configuring and testing things out inside the XenServer's local command shell, you probably are not happy with the situation where your command shell is automatically terminated and replaced by xsconsole after some period of inactivity, and you have to re-authenticate against xsconsole to open a new command shell.Read more »

Monday 15 October 2012

How to set up a DHCP server using dnsmasq

If you are trying to set up a small private network in your home or company, you probably want to set up an internal DHCP/DNS server for your network. Dnsmasq comes in handy in that situation. Dnsmasq is a free lightweight DHCP server for Linux that can serve a small-scale network. It supports static/dynamic DHCP leases and has DNS proxy functionality built in.Read more »

Friday 12 October 2012

How to launch VMware Player VMs without GUI

If you are a user of VMware Player, you may have wondered whether it's possible to run VMware player without GUI. For example, when you are accessing VMware hosts via SSH remotely, you may want to run VMware Player in shell mode. While you can use X11 forwarding over SSH to launch VMware player's GUI from remote locations, it will be rather inconvenient if the SSH connection is slow. Furthermore, the VM launched inside VMware Player's GUI window will automatically be stopped when you close the VMware Player window.Read more »

Thursday 11 October 2012

How to enable SSH with ESXi 3.5

ESX is a well-known bare metal hypervisor from VMware that runs directly on a host machine without underlying operating system support. ESXi is a free version of ESX, and while ESXi has a less number of features than ESX, the free hypervisor is good enough for various experimental purposes. In particular, ESXi 3.5 is a 32-bit hypervisor that can be installed on 32-bit processors. Most existing hypervisors such as Xen, XenServer, KVM, ESX/ESXi 4.* are all 64-bit hypervisors requiring 64-bit processors.Read more »

Wednesday 10 October 2012

How to set up DHCP and NAT on Vyatta router

Vyatta is a feature-rich enterprise class software router. You can download a free community version of Vyatta as well. Vyatta router can easily be built on a physical machine via a well-packaged LiveCD, or on a VMware/Xen VM via ready-made virtual appliance. As a ready-made software router, Vyatta can be configured extremely easily as a NAT gateway with DHCP, DNS and NAT functionality.Read more »

Tuesday 9 October 2012

How to limit the CPU usage of a Linux process

If you are a Linux system admin, there are cases where you would like to limit the CPU usage of a certain process such that at no time does the process eat up more than X% of CPU resource. cpulimit is a Linux program that can do exactly that, i.e., limiting the CPU usage of a Linux process in percentage. It monitors the CPU usage of a specified process as a daemon, and adjusts its CPU utilization dynamically.Read more »

Monday 8 October 2012

How to convert wmv to avi on Linux

Windows Media Video (WMV) is a media container and compression format used for Microsoft's proprietary codecs, and as such there are not many software that support playback of WMV files, besides Microsoft's own products such as Windows Media Player and Windows Movie Maker. On the other hand, Audio Video Interleaved (AVI) is a container format for various standard multimedia codecs such as DivX, Xvid, MPEG4, etc., and hence enjoys wider software compatibility.Read more »

Friday 5 October 2012

How to backup files to a remote FTP server using lftp

lftp is a command-line FTP client with several advanced file transfer features. For example, lftp can upload or download a whole directory tree recursively and selectively, or resume interrupted file transfers. A popular use case of lftp is to mirror local files or folders to a remote FTP server. While rsync is a popular mirroring software tool, it uses its own file synchronization protocol, and so does not work over FTP.Read more »

Thursday 4 October 2012

How to enable ssh access on Vyatta router

A fresh installation of Vyatta does not have SSH access enabled by default. Thus, if you would like to SSH to a Vyatta router, you first need to enable SSH service. In order to enable SSH access on Vyatta router, enter the following commands via its console.Read more »

Wednesday 3 October 2012

How to run MySQL query in a shell script

When you are writing a shell script as part of some batch processing, there are cases when the script needs to process data stored in a separate MySQL server. The general-purpose script languages such as Perl and Python have separate MySQL modules or interfaces to use, but shell script languages do not have such an interface for MySQL. However, there are ways to run some simple MySQL queries, and process the result even in a shell script.Read more »

Tuesday 2 October 2012

How to change a XenServer’s local storage repository from LVM to EXT

By default, XenServer create LVM-type local storage repository (SR). The LVM-type local SR does not support VHD-formatted virtual hard disks, and hence may not be an ideal option when you are using XenServer along with OpenStack which has features that require access to individual VHD files, for VM snapshot and migration. On the other hand, with EXT-type local SR, you can get direct access to VHD files.Read more »

Monday 1 October 2012

How to use local storage for CloudStack VMs

When CloudStack is deploying a VM (including guest VMs and system VMs), by default, the VM is set to use NFS-mounted primary storage as their root partition. The NFS-mounted primary storage is shared among all compute nodes located in the same CloudStack cluster. One of the reasons for using shared primary storage is VM migration. It is easy to migrate a VM from one compute node to another if the VM is backed by the same shared primary storage. If you don't need to migrate VMs, and compute nodes have plenty of local storage, you can configure CloudStack such that deployed VMs use compute node's local storage.Read more »