Category: How To

RedHat 0

Centralized Logs By RSyslog

What’s Syslog? Syslog server is a server for centralizing logs that both enterprise and small businesses using native solution or third-party solution for our log centralization. When you have syslog server in your environment, there is no concern about finding root causes even when you are faced with critical hardware problem. Because you have your logs on another storage or path or devices and you can look at them to find root cause.  There is many third-party syslog server that you can install on Windows, Linux and also deploy as virtual appliance. But we want to configure our syslog server by using RSYSLOG which it’s installed on all RedHat based distribution by default.

Eject CD-ROM on ESXi 1

Eject CD-ROM on ESXi

Many of my friends, asked me to advise them that who can they eject CD-ROM on ESXi. The below command may be useful for you as well: eject /dev/cdrom/mpx.* This is worked for me and hope works for you. Bu if you have access to server management web based portal, turning on UID LED is better way to identify your server physically.

linux penguin with logo small 0

Give permission to file/sub-directory only – Linux

Sometimes, you have to change permissions on all files within a directory or change permissions on all sub-directories in a directory. You know, we use some commands to change permission such as “chmod” or “setfacl” or other commands. But in this scenario, we want to changes all files permission in a directory and its sub-directories or change permission for all sub-directories. There is a regular command: chmod -R 755 /DirectoryPath Read and execute permissions will be granted by this command to all your directories and files but this is not working for our scenario. You can run the below command for give proper permissions to directory or sub-directories: find /path/to/base/dir -type d -exec chmod 755 {} + Or chmod 755 $(find /path/to/base/dir -type d) Or find /path/to/base/dir -type d -print0 | xargs -0 chmod 755 Also you can run same commands for files: find /path/to/base/dir -type f -exec chmod 644 {} + Or chmod 644 $(find /path/to/base/dir -type f) Or find /path/to/base/dir -type f -print0 | xargs -0 chmod 644 I hope, this post will help you to address your some permission issues.

Storage Queue 0

VMware ESXi Queue Depth – Overview, Configuration And Calculation

Queues Queues are often misrepresented as the very “bane of our existence” and yet queues restore some order of semblance to our chaotic life. Queue depth is the number of I/O requests (SCSI commands) that can be queued at one time on a storage controller. Each I/O request from the host’s initiator HBA to the storage controller’s target adapter consumes a queue entry. Typically, a higher queue depth equates to better performance. Overview Of Queues There is three layer or queue stacks: Virtualization Stack At the Virtual Machine level, there are 2 queues PVSCSI Adapter queue Per VMDK queue You can find more information on this KB: 2053145 Server Stack At a physical Server level there are 2 queues  A HBA (Host Bus Adapter) queue per physical HBA A Device/LUN queue (a queue per LUN). Please consider that if you have some servers in a cluster, using same HBA on all servers is recommended. Also if you have different HBA adapters in hosts, you can change HBA queue depth. Read this KB: 1267 Read this KB: 2044993, if you have problem with your HBA driver on ESXi 5.5 and above. About any other storage adapter, you should read its vendor...

Intel VT Issue 0

ESXi host fails with a PSOD due to an Intel Virtualization Technology!

I have read a KB on VMware Knowledge Base and it says that an Intel Virtualization Technology can be cause of PSOD. This is little funny because ESXi will be affected by wide range of Intel Xeon processor family: Intel® Xeon® Processor 55xx Series Intel® Xeon® Processor 56xx Series Intel® Xeon® Processor 65xx Series Intel® Xeon® Processor 75xx Series Intel® Xeon® Processor E5-1400 v2 Product Family Intel® Xeon® Processor E5-1600 v2 Product Family Intel® Xeon® Processor E5-1600 v3 Product Family Intel® Xeon® Processor E5-2400 Product Family Intel® Xeon® Processor E5-2400 v2 Product Family Intel® Xeon® Processor E5-2600 Product Family Intel® Xeon® Processor E5-2600 v2 Product Family Intel® Xeon® Processor E5-2600 v3 Product Family Intel® Xeon® Processor E5-2600 v4 Product Family Intel® Xeon® Processor E5-4600 Product Family Intel® Xeon® Processor E5-4600 v2 Product Family Intel® Xeon® Processor E5-4600 v3 Product Family Intel® Xeon® Processor E5-4600 v4 Product Family Intel® Xeon® Processor E7-2800 Product Family Intel® Xeon® Processor E7-4800 Product Family Intel® Xeon® Processor E7-8800 Product Family Intel® Xeon® Processor E7-8800/4800/2800 v2 Product Families Intel® Xeon® Processor E7-8800/4800 v3 Product Families Intel® Xeon® Processor E7-8800/4800 v4 Product Families There is a workaround for preventing the problem and PSOD on server but VMware...

ESXi 5.5, 6.x IOPS Limit Not Working – Disk.SchedulerWithReservation 1

ESXi 5.5, 6.x IOPS Limit Not Working – Disk.SchedulerWithReservation

Last week, we went limit some our machines IOPS but we saw the limitation is not working on our machines, after searching the issue on VMware KB, we found an KB (2059192) that explain an known issue on ESXi 5.5 and ESXi 6. It seems, disk IO scheduling model has been changed on the platforms and it’s cause of the issue. But the solution is so simple, just you need to change an ESXi’s parameter: Revert the disk I/O scheduler to an earlier version by using the vSphere Web Client In the vSphere Web Client, edit the Disk.SchedulerWithReservation parameter in the Advanced System Settings list for the host. Navigate to the host. On the Manage tab, click Settings and click Advanced System Settings. Locate the Disk.SchedulerWithReservation parameter.Note: You can use the Filter or Find text boxes to find the parameter easily. Click Edit and set the parameter to 0. Click OK. Revert the disk I/O scheduler to an earlier version by using an ESXCLI command In the ESXi Shell to the host, run this console command: esxcli system settings advanced set -o /Disk/SchedulerWithReservation -i=0 There is no need to reboot or anything else. The configuration will be applied immediately.

Check CPU, Memory and Storage OverCommitment – PowerCLI 1

Check CPU, Memory and Storage OverCommitment – PowerCLI

What’s OverCommitment? OverCommitment means virtual machines can use more resources than physical resources. CPU OverCommitment means you can create virtual machines with vCPU more than your server physical CPU, for example: Your server has two socket and each socket has 12 cores and also hyper-threading is enable, so you have 24 physical cores and 48 logical cores totally. But you can create and power on some virtual machines that those virtual machines have more than 48 cores totally. Memory OverCommitment means your virtual machines can use more memory than the physical machine (the host) has available. For example, you can have a host with 2GB memory and run four virtual machines with 1GB memory each. In that case, the memory is overcommitted. Advantages vs Disadvantages With OverCommitment, you can run more virtual machines but if you don’t have sensitive machine. If you have critical services on virtual machines, you need take care about OverCommitment because it can decrease your machines performance. How Take Care? You know, there is many native and third-party applications for monitoring vSphere environment but if you don’t have budget for buy monitoring software, you can use PowerCLI! There is a free PowerCLI module that you can...

CPU Usage 0

Installing and searching for updates is slow and high CPU usage occurs in Windows 7 and Windows Server 2008 R2

Problem Do you have Windows 7 as client OS in your VDI environment? If yes, so you should have WSUS server in your environment to download and push Microsoft updates for Windows. If you have WSUS, you need to keep started “Windows Update” service on your clients or even servers but sometimes, searching, downloading and installing updates has huge load on CPU and memory and impact on performance. These processes will impact performance when you don’t have many cores on virtual machines and it will occur on VDI clients more than servers because clients have few cores compare to servers. In my case, this issue impacted our “Call Center” users because they were working with VOIP application and CPU load has impact on voice in VDI environments. Solution Microsoft releasing updates and hot-fixes for Windows Update Client always. So keep update the client on your VDI clients. For example, Microsoft has released the below KB for resolving same issue on Windows 7 and Windows 2008 R2 recently. It’s recommended to applying the update as soon as possible to preventing any impact on client performance. KB3102810 Also you can read my previous post about same issue: Windows Update Scan – Memory...

PowerShell Linux Example 0

Install OpenSource PowerShell on CentOS 7

Recently, Microsoft has announced PowerShell for Linux and OpenSource. We can use PowerShell abilities on other OSes such as enterprise Linux, Mac OSX and Ubuntu LTS (14.04 and 16.04). I want to explain installation process for CentOS 7 in this post. Installation PowerShell At first step, we should download the proper package for your OS, PowerShell package is available for the below OSes: Ubuntu 14.04 Ubuntu 16.04 CentOS 7 or RHEL 7 Mac OS Download it form the release page. After download, we can install RPM package on our Linux machine: rpm -i powershell-6.0.0_alpha.9-1.el7.centos.x86_64.rpm Done! Now, type “powershell” in terminal and you will be redirected to PowerShell console and you be able to run Powershell commands: Also there is no case sensitivity in this console! Unlike Linux commands! You can download other packages and install the packages on other supported Operating System. Please consider that the version is Alpha version and this is not final or stable version and there is some bugs and limitation. But I’m sure that new features will be added to the future versions.

Xen Nested 1 0

Nested Virtualization – Oracle VM Server

Recently, we are working on Oracle virtualization (Oracle VM Server – Xen) solution on our lab and we have plan to deploy the solution on our Oracle (Sun) servers in production environment. At first step, we need to test the solution on our test servers and we don’t have enough resources to add additional servers to our farm just for the test. So we have to create some our server as virtual machines and test Oracle VM Server’s features such as DRS, DPM, Live Migration, Repository Migration and others. You know, you can deploy any hypervisor on your ESXi server by adding some parameters in the machine configuration file (VMX) but what is same solution for Oracle VM Server? Does it support nested virtualization? Oracle VM Server supports nested virtualization but I couldn’t find any solution on Oracle documentation center! But as you may know, Oracle uses Xen in its product as hypervisor, so I found my answer on this page: Nested Virtualization in Xen We should add some parameters to VM configuration file: hap=1 nestedhvm=1 There is some conditions: Xen 4.4 or later Intel CPU with EPT support You should read the wiki page for more information.

Restrict FTP Users To Their Home Directory Without Using OpenSSH – Oracle Linux 0

Restrict FTP Users To Their Home Directory Without Using OpenSSH – Oracle Linux

Sometimes, we want to grant access to some users for uploading and downloading (Transferring files) file via FTP server on your Linux machine. By default, any user has access to view his home directory and other directories on remote machine but we want to restrict all FTP users to their home directory and prevent uploading files from other users home directory. Also we want to disallow the user to make SSH connection and use SFTP. As the first step, you need to install “VSFTPD” as FTP server on your Linux machine and then configure some configuration files. Also we want to create a group and grant FTP permissions to the group. Here is the instructions and configurations: Step 1: Create group, users and change the users home directories: mkdir /FTP/ftpuser1 mkdir /FTP/ftpuser1/incoming mkdir /FTP/ftpuser1/outgoing groupadd ftpusers useradd -d /FTP/ftpuser1 -g ftpusers ftpuser1 passwd ftpuser1 chown root:root /FTP/ftpuser1 chmod 750 /FTP/ftpuser1 setfacl -m u:ftpuser1:rwx /FTP/ftpuser1/incoming setfacl -m u:ftpuser1:rwx /FTP/ftpuser1/outgoing Step 2: Deny the group access to SSH by editing ‘/etc/ssh/sshd_config”: Find and comment the below line: Subsystem sftp /usr/libexec/openssh/sftp-server Add the below line: Denygroup ftpusers Save and exit. Then restart “sshd” service. Step 3: Add the below lines to “/etc/vsftpd/vsftpd.conf” anonymous_enable=NO...

Collecting ESXi Logs By rsyslog 0

Collecting ESXi Logs By rsyslog

You know that you can use VMware Syslog Collector for organizing your ESXi servers logs or vCenter logs and also you can user vRealize Log Insight for monitor and analyze your logs but what if you don’t want to use them and you want to use open-source solution or you have Syslog server and you want redirect your logs to that. I want to explain rsyslog configurations for collecting ESXi logs on a Linux machine in this post. As the first step, you need to install rsyslog on your Linux distribution. I’m using rsyslog 5.8 on RHEL 6.6. The configuration is so easy, you need to find the below lines and change them same as the below or add the below lines in “/etc/rsyslog.conf”: # Provides UDP syslog reception $ModLoad imudp $UDPServerRun 514 # Provides TCP syslog reception $ModLoad imtcp $InputTCPServerRun 514 Now, you need to create a configuration file in this path: “/etc/rsyslog.d/” For example: “/etc/rsyslog.d/esxi.conf” Then add the below lines to the configuration file: #Daily Template $template Daily,”/var/log/esxi/%fromhost-ip%/%$YEAR%-%$MONTH%-%$DAY%-message.log” #Rule :fromhost-ip, startswith, “x.x.x.x” -?Daily Replace “x” with your IP address range. Actually, we have created a template for log forwarding and formatting. The ESXi logs that they are forwarded...

Re-Customize Existing Virtual Machine: Best Solution is PowerCLI Script! 0

Re-Customize Existing Virtual Machine: Best Solution is PowerCLI Script!

What do you do if have to re-customize multiple virtual machines because of human mistake during creation or anything else? I had situation that I had to re-customize virtual machines and I couldn’t create virtual machines again. What Was Exact Problem? This was our scenario: Some virtual machines exported from a vCenter and we had to import them to another vCenter. As the machines MAC addresses had been changed after restoring them to another vCenter, the machines network configurations were incorrect. We didn’t have the machines root password and we couldn’t re-configure network configuration files in the machines manually. Re-Customize Existing Virtual Machine, is it possible? Answer is yes. vCenter allows you to re-customize existing virtual machines with information of “Customization Specification”. This feature is available for single virtual machine via virtual machine’s menu. You just need to have downtime for the virtual machine because virtual machine will be powered off and power-on to re-customization complete. What About Multiple Virtual Machines? Don’t worry about the same situation, if you had customized your machine by a “Customization Specification” in vCenter and you didn’t change other network configuration files such as hosts file and others, you can re-customize the machine without having...

hv replica job re ip 2

Re-IP Rule on Linux VM: Best Solution in Veeam Backup and Replication 7.x Version and Newer

Veeam Backup & Replication is one of the best backup and replication software that you can use them in your virtual environment. Veeam BR be able to IP customization during disaster-recovery and you can have your virtual machines in a DR site with different IP plan. But Veeam BR just support Windows VMs for IP customization or “Re-IP Rule”. So what can we do about Linux virtual machines and others?