Prakash Sawarkar: Kernel 3.8 Released, how to Compile in Redhat, CenOS and Fedora..

Kernel 3.8 Released, how to Compile in Redhat, CentOS and Fedora.

Sunday, 30 December 2012

How to Install SVN (Subversion) 1.7.8 Server Using uberSVN 13.2 on RedHat/CentOS

SVN (Subversion) is an open source free version control system. It is used to manage files and directories and the modification made to them over a period of time. In short, if your server fails, then this subversion allows you to recover your older version or the updated versions of your data by examine the history of how your data has been changed over time. Sounds great, doesn’t it?. But that’s not enough, it also used to keep the track of exact modifications of files that have been made in the past. In fact, you can even cross check to see the older version and the newer version changes directly. Subversion also has some key features.

SVN Features
* Versioning can be done on individual files and directories.
* Provision for copying, adding, deleting and renaming of files and directoires.
* Keeping the track of File and directory properties over time, thereby providing a detailed history    .
* Easy to implement new network functions.
* Subversion system works with other software and programming languages.

What is uberSVN?
uberSVN is a free open source application used to provides a complete intuitive and 
configurable Web interface for Subversion with an integrated social coding 
environment with built-in Apache Subversion versioning and revision control system. 
Which makes life much easier for both users and programmers. Additional features of 
uberSVN as follow.

uberSVN Features
Provides a real time coding interface that allows developers to collaborate the 
code they commit to the repository.
A web interface for managing sever settings, user permissions and creating new 
repositories.
Support for LDAP server integration with user authentication.
Provides an automated up-to-date updater for installing updates quickly.
A web based interface for accessing repositories and managing user permissions.
A tab manager to include and configure other pages served by other web 
applications.

Requirements:-
TCP/IP networking must be configured and working.
uberSVN requires Java Runtime Environment.

Step 1: Downloading uberSVN Installer
Download the latest uberSVN 13.2 installer using the wget command (or go to 

http://www.ubersvn.com/download page to download the latest version).
 # cd /opt
 #  wget http://download.jp.as.ubersvn.com/uberSVN-32-1204.sh  (32bit)
 #  wget http://download.jp.as.ubersvn.com/uberSVN-64-1302.sh  (64bit)

Step 2: Setting Executable Permission
Set the executable permssion on installer, use the chmod command.
#  chmod +x uberSVN-xxxx.sh
Step 3: Running Installer
1. Run the installer to download files to your current direcitory, use the command.
#  ./uberSVN-xxxx.sh
Silent Install Option
In Linux you can use a 'silent install' option with arguments "-- -s", like this:
#  ./uberSVN-32-1209.sh -- -s
This will install to the default */opt/ubersvn* location.
2. The installer will start by extracting number of files. Seeing huge number of dots is normal.













3. You’ll be warned that the installer is for new deployments of uberSVN and should 
not be used for updating existing installations. Enter “Y“.
IMPORTANT: This installer is for new deployments of uberSVN and should not be used for updating existing installations!
Do you wish to continue with the installation? [Y/n] y
4. Next, you’re asked where uberSVN should be installed. Press Enter.
Where should uberSVN be installed? Note that installing to /root or a home directory (eg /home/name) may cause permission issues and is not recommended.
Enter installation location (/opt/ubersvn):
5. You are asked to confirm your install location. Enter "Y".
Are you sure you want to install to: /opt/ubersvn/ubersvn? [Y/n] y
6. You will be asked to confirm whether you want uberSVN to run on the port 1024.
Apache Subversion may be installed with the ability to run on a privileged port number below 1024. See http://www.ubersvn.com/below1024 for security considerations.
Allow Apache Subversion to run on a port below 1024? [y/N] y
7. Next you will be asked if you want to start uberSVN on boot. Enter “Y“.
Linux distribution was detected as Redhat
Do you want uberSVN to start on boot? (y/n) (y)
8. The installation will now prompt you to the URL of web interface screen, go to your browser and enter the below provided URL.
Your uberSVN installation is nearly ready. Visit the following URL to complete configuration:
http://yourip:9890/ubersvn



















Step 4: Configuring uberSVN Interface
1. This is first uberSVN setup screen. This screen shows you a Installation Directory, Repository Storage Location and uberSVN key. If you don’t have a key, then follow this link to get it free key. Click the Next button to continue.



















2. Create the Admin User‘s account. Enter full name, email address, user name and provide a password. To continue, Click the Next button.



















3. Next, setup Portal and Apache. These settings controls your’s and users access to uberSVN and repositories you set up. Enter the BASE URL with your machine actually IP address, uberSVN Port and Apache Subversion Port. These settings ensures that your Subversion repositories will be available on the network. Click the Next button to continue.




















4. Next, setup Email Settings to send out emails to your users. Enter your mail server details or Select “No“, if you don’t want to use this email feature or come back later for these settings.



















5. uberSVN will take some time to setup your settings. Once setup is completes you will able to hit on the Start using uberSVN button.
















Step 5: Logging into uberSVN Interface
You will get login prompt. Enter your admin username and password that you have entered in Step 4 of point #2.















Step 6: Creating Repositories and Adding Users
You’re now at Subversion panel, where you can easily create new repositories and set access for users.

Step 7: Starting/Stopping Subversion
1. Open a terminal and login into the system. Go to uberSVN’s binary directory.
# cd /opt/ubersvn/bin
2. Now run the start/stop script from hereon.
[root@kernelp bin]# ./ubersvncontrol start
Starting Tomcat
Using CATALINA_BASE:   /opt/ubersvn/tomcat
Using CATALINA_HOME:   /opt/ubersvn/tomcat
Using CATALINA_TMPDIR: /opt/ubersvn/tomcat/temp
Using JRE_HOME:        /home/user/jre
Using CLASSPATH:       /opt/ubersvn/tomcat/bin/bootstrap.jar
Please allow 30 seconds or so for the uberSVN portal to start

Thats it! for more details for setting up new repositories, adding users, adding teams etc. Visit docs.ubersvn.com/v1.0/admin.html

Tuesday, 20 November 2012

Linux Malware Detect -LMD

Linux Malware Detect (LMD) is a malware scanner for Linux released under the GNU GPLv2 license, that is designed around the threats faced in shared hosted environments. It uses threat data from network edge intrusion detection systems to extract malware that is actively being used in attacks and generates signatures for detection. In addition, threat data is also derived from user submissions with the LMD checkout feature and from malware community resources. The signatures that LMD uses are MD5 file hashes and HEX pattern matches, they are also easily exported to any number of detection tools such as ClamAV.

Linux Malware Detect (LMD) Features:
* MD5 file hash detection for quick threat identification
 * HEX based pattern matching for identifying threat variants
 * statistical analysis component for detection of obfuscated threats (e.g: base64)
 * integrated detection of ClamAV to use as scanner engine for improved performance
 * integrated signature update feature with -u|–update
 * integrated version update feature with -d|–update-ver
 * scan-recent option to scan only files that have been added/changed in X days
 * scan-all option for full path based scanning
 * checkout option to upload suspected malware to rfxn.com for review / hashing
 * full reporting system to view current and previous scan results
 * quarantine queue that stores threats in a safe fashion with no permissions
 * quarantine batching option to quarantine the results of a current or past scans
 * quarantine restore option to restore files to original path, owner and perms
 * quarantine suspend account option to Cpanel suspend or shell revoke users
 * cleaner rules to attempt removal of malware injected strings
 * cleaner batching option to attempt cleaning of previous scan reports
 * cleaner rules to remove base64 and gzinflate(base64 injected malware
 * daily cron based scanning of all changes in last 24h in user homedirs
 * daily cron script compatible with stock RH style systems, Cpanel & Ensim
 * kernel based inotify real time file scanning of created/modified/moved files
 * kernel inotify monitor that can take path data from STDIN or FILE
 * kernel inotify monitor convenience feature to monitor system users
 * kernel inotify monitor can be restricted to a configurable user html root
 * kernel inotify monitor with dynamic sysctl limits for optimal performance
 * kernel inotify alerting through daily and/or optional weekly reports
 * e-mail alert reporting after every scan execution (manual & daily)
 * path, extension and signature based ignore options
 * background scanner option for unattended scan operations
 * verbose logging & output of all actions

Linux Malware Detect (LMD) Installation:
Open the terminal and type following command to download and install Linux Malware Detect (LMD):

#  wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
#  tar -xzvf maldetect-current.tar.gz
#  cd maldetect-*
#  sh install.sh

After running the install script, you will be provided with successful installation output, in this information some of the main configuration and usage related information's are provided.

Using Linux Malware Detect (LMD)
The configuration of LMD is handled through /usr/local/maldetect/conf.maldet and all options are well commented for ease of configuration.

Once LMD is installed it can be run through the 'maldet' command, the '--help' option gives a detailed summary of usage options:

Below command will scan all users home dir for the malware:

#  maldet --scan-all /home

The cronjob installed by LMD is located at /etc/cron.daily/maldet and is used to perform a daily update of signatures, keep the session, temp and quarantine data to no more than 14d old and run a daily scan of recent file system changes.

performed a scan but failed to turn on the quarantine option, don’t worry just use the following command to turn on and quarantine all previous malware scan results.

# maldet --quarantine SCANID
  OR
# maldet --clean SCANID


Wednesday, 19 September 2012

oVirt version 3.2.1 released (Virtualization)

oVirt is powered by the Open Source you know - KVM on Linux.

oVirt,is comprehensive Data Center Virtualization management initiative, provides a venue for user and developer cooperation. The heart of the project is the open source code of oVirt, and the community is governed openly, modeled after the Apache Foundation, Eclipse, LVM, and many other well functioning Linux communities.

oVirt Features

* Scalability: up to 64 vCPU and 2TB vRAM per guest

* Enhanced security: SELinux and Mandatory Access Control for VMs and hypervisor


* Memory overcommit support (Kernel Samepage Merging)


* Choice of stand-alone Hypervisor or install-on-top of your existing Linux installation


* High availability


* Live migration


* Scheduled migration


* Web-based management interface


* iSCSI, FC, NFS, and Local Storage


Configure oVirt ..
Minimum hardware
4 GB memory
20 GB disk space

Optional 

Network storage

Software

Mozilla Firefox 17 or later
Internet Explorer 9 or later

Using Ovirt Live ISO boot server.

ovirt-live-1.0.iso
ovirt-node-iso-2.6.1
Step 1 -Download iso,  (1) Ovirt Managment and  (2) Hyperviosr OS

Source code:

# http://resources.ovirt.org/releases/stable/tools/ovirt-live-1.0.iso

# http://resources.ovirt.org/releases/stable/iso/ovirt-node-iso-2.6.1- 20120228.fc18.iso

Step 2- change configuration for oVirt 

#  vi /etc/hosts
#  vi /etc/sysconfig/network

   ovirt.virt.com

#  mkdir /ovirt-prakash

#  mkdir /ovirt-prakash/iso

#  mkdir /ovirt-prakash/data

#  chown 36:36 –R  /ovirt-prakash/*

#  vi /etc/sysconfig/nfs     (# add at the last line)
   NFS4_SUPPORT="no“

#  vi /etc/exports
   /ovirt-prakash/iso      0.0.0.0/0.0.0.0(rw)   #ovirt installer
   /ovirt-prakash/data   0.0.0.0/0.0.0.0(rw)   #ovirt data center

#  chkconfig nfs on
#  /etc/init.d/nfs start

#  reboot

Step 3 -Connect to oVirt Engine
The oVirt Engine provides the browser based management interface for managing your oVirt environment. It also provides command line tools for managing configuration options not exposed via the user interface as well as a series of APIs supporting automation of both common and advanced tasks.
            Now that you have installed the oVirt Engine and hosts, you can log in to the Engine administration portal to start configuring your virtualization environment.

Log In to Administration Portal
Ensure that you have the administrator password configured during installation as instructed in Example 2.1, “oVirt Engine Installation”.

To connect to oVirt web management portal

(A)   Open a browser and navigate to https://ovirt.virt.com/webadmin. Substitute       domain.example.com     with the URL provided during installation.

(B)  If this is your first time connecting to the administration portal, oVirt Engine will issue security certificates for your browser. Click the link labelled this certificate to trust the ca.cer certificate. A pop-up displays, click Open to launch the Certificate dialog. Click Install Certificate and select to place the certificate in Trusted Root Certification Authorities store.

(C)  The portal login screen displays. Enter admin as your User Name, and enter the Password that you provided during installation. Ensure that your domain is set to Internal. Click Login.

You have now successfully logged in to the oVirt web administration portal. Here, you can configure and manage all your virtual resources. The functions of the oVirt Engine graphical user interface are described in the following figure and list:






















Figure 2.4. Administration Portal Features

1) Header: This bar contains the name of the logged in user, the sign out button, the option to configure user roles.

2) Navigation Pane: This pane allows you to navigate between the Tree, Bookmarks and Tags tabs. In the Tree tab, tree mode allows you to see the entire system tree and provides a visual representation your virtualization environment's architecture.

3) Resources Tabs: These tabs allow you to access the resources of oVirt. You should already have a Default Data Center, a Default Cluster, a Host waiting to be approved, and available Storage waiting to be attached to the data center.

4) Results List: When you select a tab, this list displays the available resources. You can perform a task on an individual item or multiple items by selecting the item(s) and then clicking the relevant action button. If an action is not possible, the button is disabled.

5) Details Pane: When you select a resource, this pane displays its details in several subtabs. These subtabs also contain action buttons which you can use to make changes to the selected resource.

Once you are familiar with the layout of the administration portal, you can start configuring your virtual environment.


Configure oVirt

Now that you have logged in to the administration portal, configure your oVirt environment by defining the data center, host cluster, networks and storage. Even though this guide makes use of the default resources configured during installation, if you are setting up a oVirt environment with completely new components, you should perform the configuration procedure in the sequence given here.

Configure Data Centers

A data center is a logical entity that defines the set of physical and logical resources used in a managed virtual environment. Think of it as a container which houses clusters of hosts, virtual machines, storage and networks.

By default, oVirt creates a data center at installation. Its type is configured from the installation script. To access it, navigate to the Tree pane, click Expand All, and select the Default data center. On the Data Centers tab, the Default data center displays.



Figure 3.2. Data Centers Tab

The Default data center is used for this document, however if you wish to create a new data center see the oVirt Administration Guide.

Configure Cluster

A cluster is a set of physical hosts that are treated as a resource pool for a set of virtual machines. Hosts in a cluster share the same network infrastructure, the same storage and the same type of CPU. They constitute a migration domain within which virtual machines can be moved from host to host. By default, oVirt creates a cluster at installation. To access it, navigate to the Tree pane, click Expand All and select the Default cluster. On the Clusters tab, the Default cluster displays



Figure 3.4. Clusters Tab
For this document, the oVirt Node and Fedora hosts will be attached to the Default host cluster. If you wish to create new clusters, or live migrate virtual machines between hosts in a cluster, see the oVirt Evaluation Guide.
Configure Networking

At installation, oVirt defines a Management network for the default data center. This network is used for communication between the manager and the host. New logical networks - for example for guest data, storage or display - can be added to enhance network speed and performance. All networks used by hosts and clusters must be added to data center they belong to.
To access the Management network, click on the Clusters tab and select the default cluster. Click the Logical Networks tab in the Details pane. The ovirtmgmt network displays.


Figure 3.6. Logical Networks Tab

The ovirtmgmt Management network is used for this document, however if you wish to create new logical networks see the oVirt Administration Guide.

Configure Hosts

You have already installed your oVirt Node and Fedora hosts, but before they can be used, they have to be added to the Engine. The oVirt Node is specifically designed for the oVirt platform, therefore it only needs a simple click of approval. Conversely, Fedora is a general purpose operating system, therefore reprogramming it as a host requires additional configuration.

Approve oVirt Node Host

The Hypervisor you installed in Section 2.2.1, “Install oVirt Node” is automatically registered with the oVirt platform. It displays in the oVirt Engine, and needs to be approved for use.

To set up a oVirt Node host

On the Tree pane, click Expand All and select Hosts under the Default cluster. On the Hosts tab, select the name of your newly installed hypervisor.


Figure 3.8. oVirt Node pending approval
Click the Approve button. The Edit and Approve Host dialog displays. Accept the defaults or make changes as necessary, then click OK.



Figure 3.9. Approve oVirt Node

The host status will change from Non Operational to Up.

Attach Fedora Host

In contrast to the hypervisor host, the Fedora host you installed in Section 2.2.2, “Install Fedora Host” is not automatically detected. It has to be manually attached to the oVirt platform before it can be used.

To attach a Fedora host

1. On the Tree pane, click Expand All and select Hosts under the Default cluster. On the Hosts tab, click New.

2. The New Host dialog displays.



Figure 3.10. Attach Fedora Host

Enter the details in the following fields:

* Data Center: the data center to which the host belongs. Select the Default data   center.
* Host Cluster: the cluster to which the host belongs. Select the Default cluster.
* Name: a descriptive name for the host.
* Address: the IP address, or resolvable hostname of the host, which was provided   during installation.
* Root Password: the password of the designated host; used during installation of   the host.
* Configure iptables rules: This checkbox allows you to override the firewall   settings on the host with the default rules for oVirt.

3. If you wish to configure this host for Out of Band (OOB) power management,   select the Power Management tab. Tick the Enable Power Management checkbox and   provide the required information in the following fields:

* Address: The address of the host.
* User Name: A valid user name for the OOB management.
* Password: A valid, robust password for the OOB management.
* Type: The type of OOB management device. Select the appropriate device from the   drop down list.
* alom Sun Advanced Lights Out Manager
* apc American Power Conversion Master MasterSwitch network power switch
* bladecenter IBM Bladecentre Remote Supervisor Adapter
* drac5 Dell Remote Access Controller for Dell computers
* eps ePowerSwitch 8M+ network power switch
* ilo HP Integrated Lights Out standard
* ilo3 HP Integrated Lights Out 3 standard
* ipmilan Intelligent Platform Management Interface
* rsa IBM Remote Supervisor Adaptor
* rsb Fujitsu-Siemens RSB management interface
* wti Western Telematic Inc Network PowerSwitch
* cisco_ucs Cisco Unified Computing System Integrated Management Controller

Options: Extra command line options for the fence agent. Detailed documentation of the options available is provided in the man page for each fence agent.

Click the Test button to test the operation of the OOB management solution.
If you do not wish to configure power management, leave the Enable Power Management checkbox unmarked.

4. Click OK. If you have not configured power management, a pop-up window prompts you to confirm if you wish to proceed without power management. Select OK to continue.

5. The new host displays in the list of hosts with a status of Installing. Once installation is complete, the status will update to Reboot and then Awaiting. When the host is ready for use, its status changes to Up.

You have now successfully configured your hosts to run virtual machines. The next step is to prepare data storage domains to house virtual machine disk images.

Configure Storage

After configuring your logical networks, you need to add storage to your data center.

oVirt uses a centralized shared storage system for virtual machine disk images and snapshots. Storage can be implemented using Network File System (NFS), Internet Small Computer System Interface (iSCSI) or Fibre Channel Protocol (FCP). Storage definition, type and function, are encapsulated in a logical entity called a Storage Domain. Multiple storage domains are supported.

For this guide you will use two types of storage domains. The first is an NFS share for ISO images of installation media. You have already created this ISO domain during the oVirt Engine installation.

The second storage domain will be used to hold virtual machine disk images. For this domain, you need at least one of the supported storage types. You have already set a default storage type during installation as described in Section 2.1, “Install oVirt Engine”. Ensure that you use the same type when creating your data domain.

Select your next step by checking the storage type you should use:

1) Navigate to the Tree pane and click the Expand All button. Under System, click Default. On the results list, the Default data center displays.

2) On the results list, the Storage Type column displays the type you should add.

2) Now that you have verified the storage type, create the storage domain:

* For NFS storage, refer to Section 3.5.1, “Create an NFS Data Domain”.
* For iSCSI storage, refer to Section 3.5.2, “Create an iSCSI Data Domain”.
* For FCP storage, refer to Section 3.5.3, “Create an FCP Data Domain”.

Note: This document provides instructions to create a single storage domain, which is automatically attached and activated in the selected data center. If you wish to create additional storage domains within one data center, see the oVirt Administration Guidefor instructions on activating storage domains.

Create an NFS Data Domain

Because you have selected NFS as your default storage type during the Manager installation, you will now create an NFS storage domain. An NFS type storage domain is a mounted NFS share that is attached to a data center and used to provide storage for virtual machine disk images.

Important: If you are using NFS storage, you must first create and export the directories to be used as storage domains from the NFS server. These directories must have their numerical user and group ownership set to 36:36 on the NFS server, to correspond to the vdsm user and kvm group respectively on the oVirt Engine server. In addition, these directories must be exported with the read write options (rw). For more information see the oVirt Installation Guide.

To add NFS storage:

1. Navigate to the Tree pane and click the Expand All button. Under System, select the Default data center and click on Storage. The available storage domains display on the results list. Click New Domain.

2. The New Storage dialog box displays.



Figure 3.12. Add New Storage

Configure the following options:

* Name: Enter a suitably descriptive name.
* Data Center: The Default data center is already pre-selected.
* Domain Function / Storage Type: In the drop down menu, select Data → NFS. The storage domain types not compatible with the Default data center are grayed out. After you select your domain type, the Export Path field appears.

Use Host: Select any of the hosts from the drop down menu. Only hosts which belong in the pre-selected data center will display in this list.

Export path: Enter the IP address or a resolvable hostname of the chosen host. The export path should be in the format of 192.168.0.10:/data or domain.example.com:/data

3. Click OK. The new NFS data domain displays on the Storage tab. It will remain with a Locked status while it is being prepared for use. When ready, it is automatically attached to the data center.

You have created an NFS storage domain. Now, you need to attach an ISO domain to the data center and upload installation images so you can use them to create virtual machines. Proceed to Section 3.5.4, “Attach and Populate ISO domain”.

Create an iSCSI Data Domain

Because you have selected iSCSI as your default storage type during the Manager installation, you will now create an iSCSI storage domain. oVirt platform supports iSCSI storage domains spanning multiple pre-defined Logical Unit Numbers (LUNs).

To add iSCSI storage:

1. On the side pane, select the Tree tab. On System, click the + icon to display the available data centers.

2. Double click on the Default data center and click on Storage. The available storage domains display on the results list. Click New Domain.

3. The New Domain dialog box displays.


Figure 3.13. Add iSCSI Storage

Configure the following options:

* Name: Enter a suitably descriptive name.
* Data Center: The Default data center is already pre-selected.
* Domain Function / Storage Type: In the drop down menu, select Data → iSCSI. The   storage domain types which are not compatible with the Default data center are    grayed out. After you select your domain type, the Use Host and Discover Targets   fields display.
* Use host: Select any of the hosts from the drop down menu. Only hosts which   belong in this data center will display in this list.
4. To connect to the iSCSI target, click the Discover Targets bar. This expands the   menu to display further connection information fields.


Figure 3.14. Attach LUNs to iSCSI domain

Enter the required information:

* Address: Enter the address of the iSCSI target.
* Port: Select the port to connect to. The default is 3260.
* User Authentication: If required, enter the username and password.
5. Click the Discover button to find the targets. The iSCSI targets display in the   results list with a Login button for each target.
6. Click Login to display the list of existing LUNs. Tick the Add LUN checkbox to   use the selected LUN as the iSCSI data domain.
7. Click OK. The new iSCSI data domain displays on the Storage tab. It will remain   with a Locked status while it is being prepared for use. When ready, it is   automatically attached to the data center.

You have created an iSCSI storage domain. Now, you need to attach an ISO domain     to the data center and upload installation images so you can use them to create     virtual machines. Proceed to Section 3.5.4, “Attach and Populate ISO domain”.

  Create an FCP Data Domain

  Because you have selected FCP as your default storage type during the Manager   installation, you will now create an FCP storage domain. oVirt platform supports   FCP storage domains spanning multiple pre-defined Logical Unit Numbers (LUNs).

To add FCP storage:

1. On the side pane, select the Tree tab. On System, click the + icon to display    the available data centers.
2. Double click on the Default data center and click on Storage. The available    storage domains display on the results list. Click New Domain.
3. The New Domain dialog box displays.


Figure 3.15. Add FCP Storage

Configure the following options:

Name: Enter a suitably descriptive name.
Data Center: The Default data center is already pre-selected.
Domain Function / Storage Type: Select FCP.
Use Host: Select the IP address of either the hypervisor or Red Hat Enterprise Linux host.
The list of existing LUNs display. On the selected LUN, tick the Add LUN checkbox to use it as the FCP data domain.

4. Click OK. The new FCP data domain displays on the Storage tab. It will remain with a Locked status while it is being prepared for use. When ready, it is automatically attached to the data center.
You have created an FCP storage domain. Now, you need to attach an ISO domain to the data center and upload installation images so you can use them to create virtual machines. Proceed to Section 3.5.4, “Attach and Populate ISO domain”.

Attach and Populate ISO domain

You have defined your first storage domain to store virtual guest data, now it is time to configure your second storage domain, which will be used to store installation images for creating virtual machines. You have already created a local ISO domain during the installation of the oVirt Engine. To use this ISO domain, attach it to a data center.

To attach the ISO domain

1. Navigate to the Tree pane and click the Expand All button. Click Default. On the results list, the Default data center displays.

2. On the details pane, select the Storage tab and click the Attach ISO button.

3. The Attach ISO Library dialog appears with the available ISO domain. Select it and click OK.


Figure 3.16. Attach ISO Library

4. The ISO domain appears in the results list of the Storage tab. It displays with the Locked status as the domain is being validated, then changes to Inactive.

5. Select the ISO domain and click the Activate button. The status changes to Locked and then to Active.

Media images (CD-ROM or DVD-ROM in the form of ISO images) must be available in the ISO repository for the virtual machines to use. To do so, oVirt provides a utility that copies the images and sets the appropriate permissions on the file. The file provided to the utility and the ISO share have to be accessible from the oVirt Engine.

Log in to the oVirt Engine server console to upload images to the ISO domain.

To upload ISO images

1. Create or acquire the appropriate ISO images from boot media. Ensure the path to    these images is accessible from the oVirt Engine server.

2. The next step is to upload these files. First, determine the available ISO    domains by running:

   # engine-iso-uploader list

   You will be prompted to provide the admin user password which you use to connect    to the administration portal. The tool lists the name of the ISO domain that you    attached in the previous section.

     ISO Storage Domain List:
     local-iso-share

Now you have all the information required to upload the required files. On the Manager console, copy your installation images to the ISO domain. For your images, run:

   # engine-iso-uploader upload -i local-iso-share [file1] [file2] .... [fileN]

You will be prompted for the admin user password again, provide it and press Enter.

Note that the uploading process can be time consuming, depending on your storage performance.

3. After the images have been uploaded, check that they are available for use in    the Manager administration portal.
* Navigate to the Tree and click the Expand All button.
* Under Storage, click on the name of the ISO domain. It displays in the results   list. Click on it to display its details pane.
  On the details pane, select the Images tab. The list of available images should   be populated with the files which you have uploaded.


Figure 3.17. Uploaded ISO images

Now that you have successfully prepared the ISO domain for use, you are ready to start creating virtual machines.

Manage Virtual Machines

The final stage of setting up oVirt is the virtual machine lifecycle - spanning the creation, deployment and maintenance of virtual machines; using templates; and configuring user permissions. This chapter will also show you how to log in to the user portal and connect to virtual machines.

Create Virtual Machines

On oVirt, you can create virtual machines from an existing template, as a clone, or from scratch. Once created, virtual machines can be booted using ISO images, a network boot (PXE) server, or a hard disk. This document provides instructions for creating a virtual machine using an ISO image.

Create a Fedora Virtual Machine

In your current configuration, you should have at least one host available for running virtual machines, and uploaded the required installation images to your ISO domain. This section guides you through the creation of a Fedora virtual server. You will perform a normal attended installation using a virtual DVD.

To create a Fedora server

1. Navigate to the Tree pane and click Expand All. Click the VMs icon under the Default cluster. On the Virtual Machines tab, click New Server.


Figure 4.2. Create New Linux Virtual Machine

You only need to fill in the Name field and select Red Hat Enterprise Linux 6.x as your Operating System. You may alter other settings but in this example we will retain the defaults. Click OK to create the virtual machine.

2. A New Virtual Machine - Guide Me window opens. This allows you to add networks and storage disks to the virtual machine.



















 Figure 4.3. Create Virtual Machines


3. Click Configure Network Interfaces to define networks for your virtual machine. The parameters in the following figure are recommended, but can be edited as necessary. When you have configured your required settings, click OK.

















Figure 4.4. New Network Interface configurations

4. You are returned to the Guide Me window. This time, click Configure Virtual Disks to add storage to the virtual machine. The parameters in the following figure are recommended, but can be edited as necessary. When you have configured your required settings, click OK.
























Figure 4.5. New Virtual Disk configurations

5. Close the Guide Me window by clicking Configure Later. Your new Fedora virtual machine will display in the Virtual Machines tab.
You have now created your first Fedora virtual machine. Before you can use your virtual machine, install an operating system on it.

To install the Fedora guest operating system

1. Right click the virtual machine and select Run Once. Configure the following options:


































Figure 4.6. Run Linux Virtual Machine

Attach CD: Fedora 18

Boot Sequence: CD-ROM

Display protocol: SPICE

Retain the default settings for the other options and click OK to start the virtual machine.

2. Select the virtual machine and click the Console ( ) icon. This displays a window to the virtual machine, where you will be prompted to begin installing the operating system. For further instructions, see the Fedora Installation Guide.

3. After the installation has completed, shut down the virtual machine and reboot from the hard drive.

You can now connect to your Fedora virtual machine and start using it.

Create a Windows Virtual Machine

You now know how to create a Red Hat Enterprise Linux virtual machine from scratch. The procedure of creating a Windows virtual machine is similar, except that it requires additional virtio drivers. This example uses Windows 7, but you can also use other Windows operating systems. You will perform a normal attended installation using a virtual DVD.

To create a Windows desktop

1. Navigate to the Tree pane and click Expand All. Click the VMs icon under the Default cluster. On the Virtual Machines tab, click New Desktop.


Figure 4.7. Create New Windows Virtual Machine

You only need to fill in the Name field and select Windows 7 as your Operating System. You may alter other settings but in this example we will retain the defaults. Click OK to create the virtual machine.

2. A New Virtual Machine - Guide Me window opens. This allows you to define networks for the virtual machine. Click Configure Network Interfaces. See Figure 4.4, “New Network Interface configurations” for details.

3. You are returned to the Guide Me window. This time, click Configure Virtual Disks to add storage to the virtual machine. See Figure 4.5, “New Virtual Disk configurations” for details.

4. Close the Guide Me windows. Your new Windows 7 virtual machine will display in the Virtual Machines tab.

To install Windows guest operating system

1. Right click the virtual machine and select Run Once. The Run Once dialog displays as in Figure 4.6, “Run Linux Virtual Machine”. Configure the following options:

* Attach Floppy: virtio-win
* Attach CD: Windows 7
* Boot sequence: CD-ROM
* Display protocol: SPICE
  Retain the default settings for the other options and click OK to start the    virtual machine.
2. Select the virtual machine and click the Console ( ) icon. This displays a window to the virtual machine, where you will be prompted to begin installing the operating system.

3. Accept the default settings and enter the required information as necessary. The only change you must make is to manually install the VirtIO drivers from the virtual floppy disk (vfd) image. To do so, select the Custom (advanced) installation option and click Load Driver. Press Ctrl and select:

** Red Hat VirtIO Ethernet Adapter
** Red Hat VirtIO SCSI Controller
The installation process commences, and the system will reboot itself several times.

4. Back on the administration portal, when the virtual machine's status changes back to Up, right click on it and select Change CD. From the list of images, select RHEV-toolsSetup to attach the Guest Tools ISO which provides features including USB redirection and SPICE display optimization.

5. Click Console and log in to the virtual machine. Locate the CD drive to access the contents of the Guest Tools ISO, and launch the RHEV-toolsSetup executable. After the tools have been installed, you will be prompted to restart the machine for changes to be applied.

You can now connect to your Windows virtual machine and start using it.

Using Templates

Now that you know how to create a virtual machine, you can save its settings into a template. This template will retain the original virtual machine's configurations, including virtual disk and network interface settings, operating systems and applications. You can use this template to rapidly create replicas of the original virtual machine.

Create a Fedora Template

To make a Fedora virtual machine template, use the virtual machine you created in Section 4.1.1, “Create a Fedora Virtual Machine” as a basis. Before it can be used, it has to be sealed. This ensures that machine-specific settings are not propagated through the template.

To prepare a Fedora virtual machine for use as a template

1. Connect to the Fedora virtual machine to be used as a template. Flag the system for re-configuration by running the following command as root:
   # touch /.unconfigured
2. Remove ssh host keys. Run:
   # rm -rf /etc/ssh/ssh_host_*
3. Shut down the virtual machine. Run:
   # poweroff
4. The virtual machine has now been sealed, and is ready to be used as a template for Linux virtual machines.

To create a template from a Fedora virtual machine

1. In the administration portal, click the Virtual Machines tab. Select the sealed Red Hat Enterprise Linux 6 virtual machine. Ensure that it has a status of Down.

2. Click Make Template. The New Virtual Machine Template displays.


























Figure 4.9. Make new virtual machine template

Enter information into the following fields:

* Name: Name of the new template
* Description: Description of the new template
* Host Cluster: The Host Cluster for the virtual machines using this template.
* Make Private: If you tick this checkbox, the template will only be available to   the template's creator and the administrative user. Nobody else can use this   template unless they are given permissions by the existing permitted users.

3. Click OK. The virtual machine displays a status of "Image Locked" while the template is being created. The template is created and added to the Templates tab. During this time, the action buttons for the template remain disabled. Once created, the action buttons are enabled and the template is ready for use.

Clone a Red Hat Enterprise Linux Virtual Machine

In the previous section, you created a Fedora template complete with pre-configured storage, networking and operating system settings. Now, you will use this template to deploy a pre-installed virtual machine.

To clone a Fedora virtual machine from a template

1. Navigate to the Tree pane and click Expand All. Click the VMs icon under the Default cluster. On the Virtual Machines tab, click New Server.


Figure 4.10. Create virtual machine based on Linux template

*  On the General tab, select the existing Linux template from the Based on    Template list.
*  Enter a suitable Name and appropriate Description, then accept the default    values inherited from the template in the rest of the fields. You can change    them if needed.
** Click the Resource Allocation tab. On the Provisioning field, click the drop down menu and select the Clone option.


Figure 4.11. Set the provisioning to Clone

2. Retain all other default settings and click OK to create the virtual machine. The virtual machine displays in the Virtual Machines list.

Create a Windows Template

To make a Windows virtual machine template, use the virtual machine you created in Section 4.1.2, “Create a Windows Virtual Machine” as a basis.

Before a template for Windows virtual machines can be created, it has to be sealed with sysprep. This ensures that machine-specific settings are not propagated through the template.

Note that the procedure below is applicable for creating Windows 7 and Windows 2008 R2 templates. If you wish to seal a Windows XP template, refer to the oVirt Administration Guide.

To seal a Windows virtual machine with sysprep

1. In the Windows virtual machine to be used as a template, open a command line    terminal and type regedit.

2. The Registry Editor window displays. On the left pane, expand HKEY_LOCAL_MACHINE → SYSTEM → SETUP.

3. On the main window, right click to add a new string value using New → String    Value. Right click on the file and select Modify. When the Edit String dialog    box displays, enter the following information in the provided text boxes:

** Value name: UnattendFile
** Value data: a:\sysprep.inf

4. Launch sysprep from C:\Windows\System32\sysprep\sysprep.exe

* Under System Cleanup Action, select Enter System Out-of-Box-Experience (OOBE).
* Tick the Generalize checkbox if you need to change the computer's system   identification number (SID).
* Under Shutdown Options, select Shutdown.

Click OK. The virtual machine will now go through the sealing process and shut down automatically.

To create a template from an existing Windows machine

1. In the administration portal, click the Virtual Machines tab. Select the sealed    Windows 7 virtual machine. Ensure that it has a status of Down and click Make    Template.

2. The New Virtual Machine Template displays. Enter information into the following    fields:

Name: Name of the new template
Description: Description of the new template
Host Cluster: The Host Cluster for the virtual machines using this template.
Make Public: Check this box to allow all users to access this template.

3. Click OK. In the Templates tab, the template displays the "Image Locked" status    icon while it is being created. During this time, the action buttons for the    template remain disabled. Once created, the action buttons are enabled and the    template is ready for use.

You can now create new Windows machines using this template.
Create a Windows Virtual Machine from a Template

This section describes how to create a Windows 7 virtual machine using the template created in Section 4.2.3, “Create a Windows Template”.

To create a Windows virtual machine from a template

1. Navigate to the Tree pane and click Expand All. Click the VMs icon under the     Default cluster. On the Virtual Machines tab, click New Desktop.

*  Select the existing Windows template from the Based on Template list.
*  Enter a suitable Name and appropriate Description, and accept the default values    inherited from the template in the rest of the fields. You can change them if      needed.

2. Retain all other default setting and click OK to create the virtual machine. The    virtual machine displays in the Virtual Machines list with a status of "Image    Locked" until the virtual disk is created. The virtual disk and networking    settings are inherited from the template, and do not have to be reconfigured.

3. Click the Run icon to turn it on. This time, the Run Once steps are not required    as the operating system has already been installed onto the virtual machine hard    drive. Click the green Console button to connect to the virtual machine.

You have now learned how to create Fedora and Windows virtual machines with and without templates. Next, you will learn how to access these virtual machines from a user portal.

Using Virtual Machines

Now that you have created several running virtual machines, you can assign users to access them from the user portal. You can use virtual machines the same way you would use a physical desktop.

Assign User Permissions

oVirt has a sophisticated multi-level administration system, in which customized permissions for each system component can be assigned to different users as necessary. For instance, to access a virtual machine from the user portal, a user must have either UserRole or PowerUserRole permissions for the virtual machine. These permissions are added from the manager administration portal. For more information on the levels of user permissions refer to the oVirt Administration Guide.

To assign PowerUserRole permissions

1. Navigate to the Tree pane and click Expand All. Click the VMs icon under the    Default cluster. On the Virtual Machines tab, select the virtual machine you    would like to assign a user to.

2. On the Details pane, navigate to the Permissions tab. Click the Add button.

3. The Add Permission to User dialog displays. Enter a Name, or User Name, or part    thereof in the Search textbox, and click Go. A list of possible matches display in the results list.


Figure 4.13. Add PowerUserRole Permission

4. Select the check box of the user to be assigned the permissions. Scroll through    the Assign role to user list and select PowerUserRole. Click OK.

Log in to the User Portal

Now that you have assigned PowerUserRole permissions on a virtual machine to the user named admin, you can access the virtual machine from the user portal. To log in to the user portal, all you need is a Linux client running Mozilla Firefox.

If you are using a Fedora client, install the SPICE plug-in before logging in to the User Portal. Run:

   # yum install spice-xpi

To log in to the User Portal

1. Open your browser and navigate to https://domain.example.com/UserPortal.    Substitute domain.example.com with the oVirt Engine server address.

2. The login screen displays. Enter your User Name and Password, and click Login.

You have now logged into the user portal. As you have PowerUserRole permissions,
you are taken by default to the Extended User Portal, where you can create and manage virtual machines in addition to using them. This portal is ideal if you are a system administrator who has to provision multiple virtual machines for yourself or other users in your environment.

NOTE: When launching SPICE consoles use SHIFT+F11 to switch to fullscreen mode and SHIFT+F12 to release the mouse cursor.


Figure 4.15. The Extended User Portal

You can also toggle to the Basic User Portal, which is the default (and only) display for users with UserRole permissions. This portal allows users to access and use virtual machines, and is ideal for everyday users who do not need to make configuration changes to the system. For more information, see the oVirt User Portal Guide.


Figure 4.16. The Basic User Portal

You have now completed the Quick Start Guide, and successfully set up oVirt.


Sunday, 5 August 2012

GPFS Enable and Disable Quota Management

The General Parallel File System (GPFS) is a high-performance clustered file system that can be deployed in shared-disk or shared-nothing distributed parallel modes. It is developed by IBM. It is used by many of the world's largest commercial companies, as well as some of the supercomputers on the Top 500 List.[1] For example, GPFS is the filesystem of the ASC Purple Supercomputer[2] which is composed of more than 12,000 processors and has 2 petabytes of total disk storage spanning more than 11,000 disks.
In common with typical cluster filesystems, GPFS provides concurrent high-speed file access to applications executing on multiple nodes of clusters. It can be used with AIX 5L clusters, Linux clusters, on Microsoft Windows Server, or a heterogeneous cluster of AIX, Linux and Windows nodes. In addition to providing filesystem storage capabilities, GPFS provides tools for management and administration of the GPFS cluster and allows for shared access to file systems from remote GPFS clusters.

Enable and Disable Quota Management for GPFS.

Taken from GPFS Administration and Programming Reference Enabling and disabling GPFS quota management
To enable GPFS quota management on an existing GPFS file system.
1) Unmount the file system everywhere.
2) Run the mmchfs -Q yes command. This command automatically activates quota enforcement whenever   the file system is mounted.
3) Remount the file system, activating the new quota files. All subsequent mounts follow the new quota     setting.
4) Compile inode and disk block statistics using the mmcheckquota command. The values obtained can be used to establish realistic quota values when issuing the mmedquota command.
5) Issue the mmedquota command to explicitly set quota values for users, groups, or filesets.

Once GPFS quota management has been enabled, you may establish quota values by:
1.Setting default quotas for all new users, groups of users, or filesets.
2. Explicitly establishing or changing quotas for users, groups of users, or filesets.
3. Using the gpfs_quotactl() subroutine.
To Disable quota management:
Step-1 Unmount the file system everywhere.
Step-2 Run the # mmchfs -Q no command.
Step-3 Remount the file system, deactivating the quota files. All subsequent mounts obey the new quota setting.
To Enable GPFS quota management on a new GPFS file system: 
Step-1 Run  # mmcrfs -Q yes command. This option automatically activates quota enforcement whenever the file system is mounted.
Step-2 Mount the file system.
Step-3 Issue the mmedquota command to explicitly set quota values for users, groups, or filesets. See Explicitly establishing and changing quotas.

Thursday, 26 July 2012

Installing Redmine on CentOS 6.2 With MySQL and Apache

Pre-requisites
Logged as root, install the following packages:
Step 1
#   yum install make gcc gcc-c++ zlib-devel ruby-devel rubygems ruby-libs apr-devel apr-util-devel httpd-devel mysql-devel mysql-server automake autoconf ImageMagick ImageMagick-devel curl-devel
And then install the bundle ruby gem:
#  gem install bundle
Install Redmine
Redmine is installed with the following commmands:

#  cd /var/www
#  wget http://rubyforge.org/frs/download.php/76255/redmine-1.4.4.tar.gz
#  tar zxf redmine-1.4.4.tar.gz
#  ln -s redmine-1.4.4 redmine
#  rm -f redmine-1.4.4.tar.gz
Install Redmine ruby dependencies
Bundle helps us install the ruby Redmine dependencies:
#  cd /var/www/redmine
#  bundle install --without postgresql sqlite test development
Database creation
First we start MySQL:
#  service mysqld start
Then we secure it (Optional):
#  mysql_secure_installation
We then create the redmine database and user:
$ mysql
mysql> create database redmine character set utf8;
mysql> grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'my_password';
mysql> flush privileges;
mysql> quit
Redmine database configuration

We copy the database configuration example and we modify it to point to our newly created database:
#  cd /var/www/redmine/config
#  copy database.yml.example database.yml
On the database.yml file, the production section should look like this:
 1production:
 2 adapter: mysql
 3database: redmine
 4 host: localhost
 5 username: redmine
 6password: my_password
 7encoding: utf8
And then we create and populate the database with the following rake commands:

#  cd /var/www/redmine
#  rake generate_session_store
#  rake db:migrate RAILS_ENV="production"
#  rake redmine:load_default_data RAILS_ENV="production"
Outgoing email configuration (Optional)
To configure an outgoing SMTP server for sending emails, we create the config/configuration.yml file from the sample:
#  cd /var/www/redmine/config
#  cp configuration.yml.example configuration.yml
And edit it to provide our configuration :
 1production:
 2 email_delivery:
 3 delivery_method: :smtp
 4 smtp_settings:
 5 address: "smtp.mydomain.com"
 6 port: 25
 7 domain: "mydomain.com"
Redmine standalone testing

At this point, Redmine can be tested in standalone mode by running the following command:

#  cd /var/www/redmine/
#  ruby script/server webrick -e production
and open the http://localhost:3000 addess in a browser. If you are testing from another computer, you will need to open the port in the /etc/sysconfig/iptables file by duplicating the ssh (port 22) line and adapting it:

#  -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
#  -A INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT
Then apply the new configuration with the following command:

#  service iptables restart
Passenger installation

To install Phusion passenger, we firts install its gem:

#  gem install passenger
And then install the Apache module with the command:

#  passenger-install-apache2-module
Apache configuration

We remove the default Apache configuration and replace it by a new one:

#  cd /etc/httpd
#  mv conf.d available
#  mkdir conf.d
In the empty new conf.d folder, we create a redmine.conf file with the following configuration:

# Loading Passenger
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13
PassengerRuby /usr/bin/ruby

<VirtualHost *:80>
   ServerName redmine.mycompany.com
   DocumentRoot /var/www/redmine/public
   <Directory /var/www/redmine/public>
      # This relaxes Apache security settings.
      AllowOverride all
      # MultiViews must be turned off.
      Options -MultiViews
      allow from all
   </Directory>

   ErrorLog "|/usr/sbin/rotatelogs /etc/httpd/logs/redmine-error.%Y-%m-%d.log 86400"
   CustomLog "|/usr/sbin/rotatelogs /etc/httpd/logs/redmine-access.%Y-%m-%d.log 86400" "%h %l %u %t %D \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""

</VirtualHost>
We then enable named based virtual hosting for our server by uncomenting the following line in the /etc/httpd/conf/httpd.conf file:
...
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
...
We give full access on the redmine folder to the apache user and test the configuration:

#  chown -R apache:root /var/www/redmine
#  service httpd configtest
At this point, the SELinux configuration needs to be modified to allow our apache instance to run the phusion passenger module. You can do this by putting SELinux in permissive mode:

#  setenfore Permissive
And letting the Permissive mode survive a reboot by modifyin the /etc/selinux/config file from:
SELINUX=enforcing
to
SELINUX=permissive
If you want to run redmine while enforcing, you may want to apply the method described here for which you will need to install the policycoreutils-python package.
In any case, you will start Apache with the command:
#  service httpd start
Now you can access your Redmine installation with your browser. To access it from all the computers in your network, you will need to open the port 80 in the /etc/sysconfig/iptables. You can replace the 3000 rule by :
#  -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
#  -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
And restart iptables.

#  service iptables restart
Start services at boot

To have MySQL and Apache started at boot, run the commands:
#  chkconfig --level 345 mysqld on
#  chkconfig --level 345 httpd on
Cleaning up

A quick command to clean up all the devel stuff needed for installation:
#  yum remove '*-devel' make automake autoconf
Tips

Don’t forget that if you change your Redmine configuration, you don’t have to restart Apache. Your can restart only Redmine with the command:

#  touch /var/www/redmine/tmp/restart.txt
If you restore data on your server from another redmine instance that runs on a previous version, dont forget to migrate your data:

#  cd /var/www/redmine
#  rake db:migrate RAILS_ENV="production"