Linux administration , Unix administration , Vmware Vsphere administration , Oracle DBA ,apache, backup, dhcp, dns, kvm, xen, kernel, ldap, kvm, monitoring, ticketing, networking, Mail servers, SAN,troubleshooting
Labels
- Amanda (2)
- Ansible (2)
- Answer these Questions (2)
- antivirus (2)
- apache (3)
- Bash (16)
- Chef (3)
- Citrix (2)
- clusters (2)
- Concept (22)
- DatabaseAdminstration (11)
- DevOps (1)
- dhcp (2)
- Downloads (3)
- ELK (1)
- ELK stack (1)
- encryption (1)
- Free trainings (1)
- Frequently Used Commands (46)
- FTP (1)
- git (1)
- gpg (2)
- Hardware (1)
- httpd (2)
- Interview Questions (53)
- iptables (1)
- IT NEWS (3)
- java (1)
- kibana (2)
- knife (1)
- KVM (2)
- linux (17)
- Linux installations (22)
- Linux Jobs (4)
- Linux Links (2)
- logstash (1)
- Mac (1)
- MediaWiki (1)
- MySql (2)
- Nagios (2)
- Networking (3)
- open Nebula (5)
- Open Source tools (12)
- OpenNMS (1)
- openSSL (1)
- Oracle on Linux (5)
- Performance Monitoring (1)
- php (1)
- postfix (1)
- postgres (1)
- postgres-XL (1)
- Product Reviews (1)
- Python (2)
- rssh (1)
- Samba (2)
- Scripting (16)
- security (4)
- selinux (1)
- Server (1)
- SFTP (1)
- Social Awareness (1)
- Solaris (1)
- SSL (1)
- svn (1)
- TCP/IP (1)
- Technology (1)
- Tips and Tricks (32)
- Training and materials (8)
- Troubleshooting (6)
- Ubuntu (18)
- unix (1)
- virtualization (17)
- Vmware (25)
- Vyatta (1)
- windows7 (1)
- xml (1)
Overview of OpenNebula Step by Step Guide - Shashank Rachamalla ( Hexagrid networks )
( Ref : OpenNubula.org )
OpenNebula can be primarily used as a virtualization tool to manage your virtual infrastructure in the data-center or cluster.
Node Installation
* Request Manager, to handle client requests
* Virtual Machine Manager, to manage and monitor of VMs
* Transfer Manager, to manage VM images
* Virtual Network Manager, to manage virtual networks
* Host Manager, to manage and monitor physical resources
* Database, persistent storage for ONE data structures
OpenNebula does the following:
------------------------------------
* Manages Virtual Networks. Virtual networks interconnect VMs. Each Virtual Networks includes a description.
* Creates VMs. The VM description is added to the database.
* Deploys VMs. According to the allocation policy, the scheduler decides where to execute the VMs.
* Manages VM Images. Before execution, VM images are transferred to the host and swap disk images are created. After execution, VM images may be copied back to the repository.
* Manages Running VMs. VM are started, periodically polled to get their consumption and state, and can be shutdown, suspended, stopped or migrated.
The main functional components of an OpenNebula Private Cloud are the following:
-------------------------------------------------------------------------------------
* Hypervisor: Virtualization manager installed in the resources of the cluster that OpenNebula leverages for the management of the VMs within each host.
* Virtual Infrastructure Manager: Centralized manager of VMs and resources, providing virtual network management, VM life-cycle management, VM image management and fault tolerance.
* Scheduler: VM placement policies for balance of workload, server consolidation, placement constraints, affinity, advance reservation of capacity and SLA commitment.
Daemon Configuration Attributes
-------------------------------------
* HOST_MONITORING_INTERVAL : Time in seconds between host monitorization
* VM_POLLING_INTERVAL : Time in seconds between virtual machine monitorization
* VM_DIR : Remote path to store the VM images, it should be shared between all the cluster nodes to perform live migrations. This path will be used for all the cluster nodes.
* MAC_PREFIX: Default MAC prefix to generate virtual network MAC addresses
* NETWORK_SIZE: Default size for virtual networks
* PORT : Port where oned will listen for xml-rpc calls
* DEBUG_LEVEL : Sets the level of verbosity of $ONE_LOCATION/var/oned.log log file. Possible values are:
DEBUG_LEVEL Meaning
---------------------------------
0 ERROR
1 WARNING
2 INFO
3 DEBUG
Command line interface
--------------------------------
* onevm: to submit, control and monitor virtual machines
* onehost: to add, delete and monitor hosts
$ onehost list
HID NAME RVM TCPU FCPU ACPU TMEM FMEM STAT
0 host01 0 800 800 800 8194468 7867604 on
1 host02 0 800 797 800 8387584 1438720 on
$ onevm list
ID USER NAME STAT CPU MEM HOSTNAME TIME
1001 oneadmin fc11AOS dele 0 512000 node2 02 22:10:56
OpenNebula can be primarily used as a virtualization tool to manage your virtual infrastructure in the data-center or cluster.
- OpenNebula is a toolkit for building Clouds ( public cloud,private cloud )
- It Supports KVM , Xen , Vmware Server , VirtualBox (planned from 1.4.2)
- It consists of Front End , Node
$ sudo apt-get install opennebula Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: opennebula-common The following NEW packages will be installed: opennebula opennebula-common 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded. Need to get 280kB of archives. After this operation, 1352kB of additional disk space will be used. Do you want to continue [Y/n]? … Setting up opennebula-common (1.2-0ubuntu1~intrepid1) … … Adding system user `oneadmin’ (UID 107) … Adding new user `oneadmin’ (UID 107) with group `nogroup’ … Generating public/private rsa key pair. … Setting up opennebula (1.2-0ubuntu1~intrepid1) … oned and scheduler started
Node Installation
$ sudo apt-get install opennebula-node Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: opennebula-common The following NEW packages will be installed: opennebula-common opennebula-node ... Setting up opennebula-node (1.2-0ubuntu1~intrepid1) ... Adding user `oneadmin' to group `libvirtd' ... Adding user oneadmin to group libvirtd Done.
OpenNebula Core
----------------------* Request Manager, to handle client requests
* Virtual Machine Manager, to manage and monitor of VMs
* Transfer Manager, to manage VM images
* Virtual Network Manager, to manage virtual networks
* Host Manager, to manage and monitor physical resources
* Database, persistent storage for ONE data structures
OpenNebula does the following:
------------------------------------
* Manages Virtual Networks. Virtual networks interconnect VMs. Each Virtual Networks includes a description.
* Creates VMs. The VM description is added to the database.
* Deploys VMs. According to the allocation policy, the scheduler decides where to execute the VMs.
* Manages VM Images. Before execution, VM images are transferred to the host and swap disk images are created. After execution, VM images may be copied back to the repository.
* Manages Running VMs. VM are started, periodically polled to get their consumption and state, and can be shutdown, suspended, stopped or migrated.
The main functional components of an OpenNebula Private Cloud are the following:
-------------------------------------------------------------------------------------
* Hypervisor: Virtualization manager installed in the resources of the cluster that OpenNebula leverages for the management of the VMs within each host.
* Virtual Infrastructure Manager: Centralized manager of VMs and resources, providing virtual network management, VM life-cycle management, VM image management and fault tolerance.
* Scheduler: VM placement policies for balance of workload, server consolidation, placement constraints, affinity, advance reservation of capacity and SLA commitment.
Daemon Configuration Attributes
-------------------------------------
* HOST_MONITORING_INTERVAL : Time in seconds between host monitorization
* VM_POLLING_INTERVAL : Time in seconds between virtual machine monitorization
* VM_DIR : Remote path to store the VM images, it should be shared between all the cluster nodes to perform live migrations. This path will be used for all the cluster nodes.
* MAC_PREFIX: Default MAC prefix to generate virtual network MAC addresses
* NETWORK_SIZE: Default size for virtual networks
* PORT : Port where oned will listen for xml-rpc calls
* DEBUG_LEVEL : Sets the level of verbosity of $ONE_LOCATION/var/oned.log log file. Possible values are:
DEBUG_LEVEL Meaning
---------------------------------
0 ERROR
1 WARNING
2 INFO
3 DEBUG
Command line interface
--------------------------------
* onevm: to submit, control and monitor virtual machines
* onehost: to add, delete and monitor hosts
$ onehost list
HID NAME RVM TCPU FCPU ACPU TMEM FMEM STAT
0 host01 0 800 800 800 8194468 7867604 on
1 host02 0 800 797 800 8387584 1438720 on
$ onevm list
ID USER NAME STAT CPU MEM HOSTNAME TIME
1001 oneadmin fc11AOS dele 0 512000 node2 02 22:10:56
Linux command to list all threads of a particular process
lets take firefox-bin
ps -C firefox-bin -L -o pid,tid,pcpu,state
ps -C firefox-bin -L -o pid,tid,pcpu,state
command to list linux processes by CPU usage percentage
ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d'
Linux command for DNS cache cleaning
this will clean DNS cache for every OS , for this ncsd tool must be installed and should run in background as a
daemon and need root privileges.
/etc/init.d/nscd restart
daemon and need root privileges.
/etc/init.d/nscd restart
how to find a single users disk space usage
find / -user naresh -fstype 4.2 ! -name /dev/\* -ls | \ awk '{sum+=$7}; END {print "User naresh total disk use = " sum}'
change both the user and group owner in a single operation
chown new-owner:new-group files
chown -R naresh:developer /home/naresh
chown -R naresh:developer /home/naresh
change the ownership of an entire directory tree recursively
chown -R harvey /home/username/personal
Migrating Windows XP Virtual Machine from ESX to KVM
Before converting any Windows Virtual Machine we have to enable IDE in the registry and uninstall VMware tools form VM.
1. Uninstall VMware tools form VM
2. Below is the process to enable IDE in Windows registry.
Login into the VM which you want to migrate, extract the Atapi.sys, Intelide.sys, Pciide.sys, and Pciidex.sys files from the
%SystemRoot%\Driver Cache\I386\Driver.cab file, and copy into the %SystemRoot%\System32\Drivers folder.
Now we will Import new registry settings into windows registry
Open regedit-->Go to file-->Export-->Give a file name-->Click save to save a registry file.
Right Click on saved reg file and click-->Edit-->Open below link-->Copy each line from below link-->Replace copied data into Opened registry file-->Save the registry file
3. Shutdown the VM and Copy VMDK,Flat.VMDK and VMX files to KVM machine.
#scp 10014-1001.vmdk 10014-1001-flat.vmdk 10014-1001.vmx user@KVM Server ip:/var/lib/libvirt/images/
4. Now we will convert .vmx to .xml and .vmdk to .qcow2. We will use vmware2libvirt to convert .vmx file to .xml .
Below command to install virt-goodies in your KVM system.
#apt-get install virt-goodies
5. Convert 10014-1001.vmx to file.xml
#vmware2libvirt -f ./10014-1001.vmx > file.xml
Above command converts the VMware '10014-1001.vmx' file to the libvirt compatible 'file.xml'.
6. Define xml file
# virsh -c qemu:///system define file.xml
Above command imports file.xml into libvirt. The imported .xml files are stored in /etc/libvirt/qemu.
7. Now we will convert .vmdk file to qcow2 format
#qemu-img convert 10014-1001-flat.vmdk -O qcow2 new-diskname.qcow2
Now we have converted .vmx to .xml and .vmdk to .qcow2 file, we need to edit VMNAME, OS Arch & Disk name or source file name in xml file. Please find below is the sample of a xml file. Open the converted xml file and Change VM name as you want, change "type arch" to x86_64, change source file name.
Below command will open file.xml to edit.
#virsh edit file.xml
In the above XML you can see my disk is pointed new-diskname.qcow2 which we have converted to qcow2 format.
Note:While vmware2libvirt works well on simple virtual machines, there are limitations because .vmx files don't always contain enough information, and also because vmware2libvirt tries not to make too many assumptions about what it finds. A couple of things to look out for: While vmware2libvirt attempts to detect a 64-bit guest, be sure that your 64-bit guest has in its .xml file:
hvm
vmware2libvirt only detects and uses the first ethernet interface found. Additional interfaces can be added from within virt-manager.
Currently the first scsi disk is used if found, otherwise the first ide disk. Additional disks can be added from within virt-manager.
The converted virtual machine is hard-coded to use 1 cpu. This can be changed with:
2
8. Define the xml file and start the VM.
#virsh -c qemu:///system define file.xml
#virsh start vmname
Above command imports file.xml into libvirt. The imported .xml files are stored in /etc/libvirt/qemu.Next command will start VM.
1. Uninstall VMware tools form VM
2. Below is the process to enable IDE in Windows registry.
Login into the VM which you want to migrate, extract the Atapi.sys, Intelide.sys, Pciide.sys, and Pciidex.sys files from the
%SystemRoot%\Driver Cache\I386\Driver.cab file, and copy into the %SystemRoot%\System32\Drivers folder.
Now we will Import new registry settings into windows registry
Open regedit-->Go to file-->Export-->Give a file name-->Click save to save a registry file.
Right Click on saved reg file and click-->Edit-->Open below link-->Copy each line from below link-->Replace copied data into Opened registry file-->Save the registry file
3. Shutdown the VM and Copy VMDK,Flat.VMDK and VMX files to KVM machine.
#scp 10014-1001.vmdk 10014-1001-flat.vmdk 10014-1001.vmx user@KVM Server ip:/var/lib/libvirt/images/
4. Now we will convert .vmx to .xml and .vmdk to .qcow2. We will use vmware2libvirt to convert .vmx file to .xml .
Below command to install virt-goodies in your KVM system.
#apt-get install virt-goodies
5. Convert 10014-1001.vmx to file.xml
#vmware2libvirt -f ./10014-1001.vmx > file.xml
Above command converts the VMware '10014-1001.vmx' file to the libvirt compatible 'file.xml'.
6. Define xml file
# virsh -c qemu:///system define file.xml
Above command imports file.xml into libvirt. The imported .xml files are stored in /etc/libvirt/qemu.
7. Now we will convert .vmdk file to qcow2 format
#qemu-img convert 10014-1001-flat.vmdk -O qcow2 new-diskname.qcow2
Now we have converted .vmx to .xml and .vmdk to .qcow2 file, we need to edit VMNAME, OS Arch & Disk name or source file name in xml file. Please find below is the sample of a xml file. Open the converted xml file and Change VM name as you want, change "type arch" to x86_64, change source file name.
Below command will open file.xml to edit.
#virsh edit file.xml
In the above XML you can see my disk is pointed new-diskname.qcow2 which we have converted to qcow2 format.
Note:While vmware2libvirt works well on simple virtual machines, there are limitations because .vmx files don't always contain enough information, and also because vmware2libvirt tries not to make too many assumptions about what it finds. A couple of things to look out for: While vmware2libvirt attempts to detect a 64-bit guest, be sure that your 64-bit guest has in its .xml file:
hvm
vmware2libvirt only detects and uses the first ethernet interface found. Additional interfaces can be added from within virt-manager.
Currently the first scsi disk is used if found, otherwise the first ide disk. Additional disks can be added from within virt-manager.
The converted virtual machine is hard-coded to use 1 cpu. This can be changed with:
2
8. Define the xml file and start the VM.
#virsh -c qemu:///system define file.xml
#virsh start vmname
Above command imports file.xml into libvirt. The imported .xml files are stored in /etc/libvirt/qemu.Next command will start VM.
How to see log files in linux
tail -f vmware.log -----Output data as the file grows,by default shows last 10 lines
tail -n 15 vmware.log--------Print last N lines instead of last 10
tail -n 15 vmware.log--------Print last N lines instead of last 10
how to change network card in vm
before add this line delete old netadapter from vmx file
ethernet0.virtualDev = "vmxnet"
ethernet0.features = "15"
ethernet0.virtualDev = "vmxnet"
ethernet0.features = "15"
Copy files from one hypervisor to another hypervisor
scp source filename destinatin path
Ex:scp /home/learnadmin/pr.vmx root@192.168.1.61:/home/learnadmin2/la2
then it will ask destination's root password
Ex:scp /home/learnadmin/pr.vmx root@192.168.1.61:/home/learnadmin2/la2
then it will ask destination's root password
Copying files betweent two remote meachines , different ssh consoles, using SCP command
scp filename targetssh username@ipadd:target path
ex: scp 2003.iso root@192.168.1.61:/vmfs/volums/datastore1/iso
ex: scp 2003.iso root@192.168.1.61:/vmfs/volums/datastore1/iso
Set java path on Ubuntu meachine
open Vi /etc/bash.bashrc
and then append the following lines
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$PATH:$JAVA_HOME/bin
and then append the following lines
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$PATH:$JAVA_HOME/bin
Subscribe to:
Posts (Atom)