Installation vm

  • View

  • Download

Embed Size (px)


  • 1.How to install a virtualmachinemartes 17 de agosto de 2010

2. Introduction Install JDK Install RPM packages How to create a virtual machine host martes 17 de agosto de 2010 3. Introduction docs: To check if KVM has successfully been installed,run virsh -c qemu:///system list acces to root, need the key: su It should display something like this: installation virtual machine yum install virt-managervirsh -c qemu:///system list Id NameState ---------------------------------- installation libraries yum install kvm qemu libvirt python- virtinst martes 17 de agosto de 2010 4. Install JDK Browse to and I have to also set JAVA_HOME to point to the jdk so I select the relevant link. In this case .I wanted a .bin le look for the .batch_prole le and edit it. And add for fedora 12 so I selected it under the Linux headingthe entry export JAVA_HOME=/usr/java/jdk1.6.0_21. Save and then logout and then login. Got the url path (right-click select properties) and in the terminal I entered the command sudo wget ensure that the path is correct by running This then download the .bin le to the directory I wasecho $JAVA_HOME in. and it returns the correct location. Then launch JBoss without any errors!!!! I then changed the permissions on the le using chmod a+x to make it executable. I the ran the le and it installed to a java folder I had created in /usr/bin/. When I do an ls it shows me the JDK folder. martes 17 de agosto de 2010 5. Install RPM packages docs: de LVM in the Virtual machine like rootsudo yum install system-cong-lvmRestart the virtual machine, and connect again ( -X option is for see the window with the information about the partitions)rebootssh test@tst01 -XWhen you have this, you can see the window with all the information about the LVM volumes, using this commandsudo system-cong-lvm martes 17 de agosto de 2010 6. How to create a virtualmachine hostPrerequisites: To check if KVM has successfully been installed,runvirshYou need kvm up and running It should display something like this: virsh # net-list --all If you don't want to run as root, the user you want to useneeds to have rw access to /dev/kvm If it displays an error instead, then something wentwrong.If you want to be able to access the internet or a local Next we need to set up a network bridge on ournetwork, your host system must be able to access theserver so that our virtual machines can beinternet or the local network accessed from other hosts as if they were physicalsystems in the network. To install KVM and virtinst (a tool to create virtual To do this, we install the package bridge-utils...yum install bridge-utilsmachines), we runyum install kvm qemu libvirt python-virtinst qemu-kvm ... and congure a bridge.Then start the libvirtdaemon:/etc/init.d/libvirtd start martes 17 de agosto de 2010 7. Starting to testVM, JBoss, Harmony, Apache martes 17 de agosto de 2010 8. Introduction Expanding the disk capacity Creating the load balancer and the nodes Run JBoss with Harmonymartes 17 de agosto de 2010 9. Introduction docs: software testing Go to the other server were I have the interface that I wiki/Software_testingneed use. And copy the les. We have a server, where we installation the S.O. In this ssh test@test02 case I install ubuntu. A when I have installed i do the less /etc/network/interfaces following (my host machine called test02): sudo -i ls -al ifcong | less shutdown To see the directory where I stay pwdsudo /etc/init.d/networking restart Go inside like a root user sudo -i ls -al martes 17 de agosto de 2010 10. Expanding the diskcapacity Device Boot Start End Blocks Id System /dev/sdb11 9726 78124063+ 5 Extended /dev/sdb5112 96327 83 Linux We have two hard Drives, when we have the les, we /dev/sdb6 135594393746 82 Linux swap / need put together and start the other hard drive.Solaris /dev/sdb7560 972673633896 83 Linux To see the disk on your computer root@test02:~# fdisk -lYou can verify this situation with the df -k command's output,which also shows that the other partitions are too full to acceptany more data. Disk /dev/sda: 80.0 GB, 80000000000 bytesroot@test02:~# df -k 255 heads, 63 sectors/track, 9726 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Filesystem 1K-blocks Used Available Use% Mounted on Disk identier: 0x00000080 /dev/mapper/test02-root73444600 1147652 68566108 2% / Device Boot StartEndBlocks Id System tmpfs 20326400 2032640 0% /lib/init/rw /dev/sda1 *19695 77875056 8e Linux LVM varrun2032640 112 2032528 1% /var/run /dev/sda2 9696 9726 249007+ 5 Extended varlock 20326400 2032640 0% /var/lock /dev/sda5 9696 9726 248976 83 Linuxudev2032640160 2032480 1% /devtmpfs 20326400 2032640 0% /dev/shm Disk /dev/sdb: 80.0 GB, 80000000000 byteslrm20326402760 2029880 1% 255 heads, 63 sectors/track, 9726 cylinders /lib/modules/2.6.28-11-server/volatile Units = cylinders of 16065 * 512 = 8225280 bytes /dev/sda5 233335 14320 206567 7% /boot Disk identier: 0x00000080 martes 17 de agosto de 2010 11. Linux stores the names of all known disk partitions in the /proc/partitions le. The entire hard disk is represented by an entry with a minor number of 0, and The rst Linux step in adding a new disk is to partition it in all the partitions on the drive are sequentially preparation of adding a lesystem to it. Type the fdisk command numbered after that. followed by the name of the disk.You want to run fdisk on the /dev/sdb disk, so the command is: root@test02:~# fdisk /dev/sdb root@test02:~# cat /proc/partitions The number of cylinders for this disk is set to 9726. major minor #blocks name There is nothing wrong with that, but this is larger than 1024, 8078125000 sda and could in certain setups cause problems with: 8177875056 sda1 82 1 sda2 1) software that runs at boot time (e.g., old versions of LILO) 85 248976 sda5 2) booting and partitioning software from other OSs 8 1678125000 sdb 8 17 1 sdb1 (e.g., DOS FDISK, OS/2 FDISK) 8 21 96327 sdb5 8 22 4393746 sdb6 8 2373633896 sdb7 252074616832 dm-0 2521 3211264 dm-1 martes 17 de agosto de 2010 12. Just to make sure you're on the correct device, issuethe p command to print all the known partitions onthe disk. In this case, there are none which is good.Command (m for help): p The fdisk m command prints a small help manual of validcommands.You will see that n is the command to add a newpartition. Add a new primary partition, number 1, and use thedefaults to make the partition occupy the entire disk. Command (m for help): p Disk /dev/sdb: 80.0 GB, 80000000000 bytes Command (m for help): n Command (m for help): n255 heads, 63 sectors/track, 9726 cylinders Command action l logical (5 or over)Units = cylinders of 16065 * 512 = 8225280 bytes p primary partition (1-4) pDisk identier: 0x00000080 Partition number (1-4): 1 Partition 1 is already dened. Delete it before re-adding it.Device BootStart EndBlocks Id System/dev/sdb1 19726 78124063+ 5 Extended/dev/sdb5 112 96327 83 Linux/dev/sdb6 13559 4393746 82 Linuxdev/sdb75609726 73633896 83 Linux martes 17 de agosto de 2010 13. Run the print (p) command to conrm that you successfully created the partition partition. root@test02:/# pvcreate /dev/sdb1 Command (m for help): p Physical volume "/dev/sdb1" successfully created root@test02:/# vgextend test02 /dev/sdb1 Volume group "test02" successfully extended To save the changes. Command (m for help): w root@test02:/# vgdisplayThe partition table has been altered! --- Volume group ---Calling ioctl() to re-read partition table. VG Nametest02Syncing disks. System ID Formatlvm2 Metadata Areas2 Metadata Sequence No 4 You can take a look at the /proc/partitions le or use the VG Accessread/write fdisk -l command to see the changes to the disk VG Status resizable partition structure of your system: MAX LV0 Cur LV2 root@test02:~# cat /proc/partitions Open LV2 Max PV 0 Cur PV2 Act PV 2 You now need to format the partition, giving it a new VG Size148.77 GB directory structure by using the mkfs command. The Fedora installation procedure defaults to an ext3 type, PE Size4.00 MB which is what you should use here. Total PE 38085 Alloc PE / Size19001 / 74.22 GB root@test02:~# mkfs -t ext3 /dev/sdb1 Free PE / Size 19084 / 74.55 GB VG UUID 9nQQaX-dvOr-1xuf-KkFr-A5jz-Fg0h- martes 17 de agosto de 2010 14. Creating the load balancer and the nodes Create LVM volume for boot partition Mount vm-sharesudo lvcreate -L 1GM -n jboss_boot sudo mount build:/nfs/vm-share /mnt/test02(where test02 is your volume group vm-share (maybe already mounted)name) Create LVM volume for root partitionsudo lvcreate -L 11GM -n jboss_ctrltest02 (where test02 is your volume groupname) Create Swapsudo lvcreate -L 1GM -n jboss_ctrl_swaptest02 (where test02 is your volume groupname) martes 17 de agosto de 2010 15. jboss_ctrljboss_ctrl028d695160-06e3-6af1-03b7-05d368c54aa8uuid> Copy boot system10485764104857610485764104857622 sudo dd if=/mnt/vm-share/images/ hvmhvm fedora-12-dev/fedora-boot.img of=/ dev/test02/jboss_boot Copy root systemdestroydestroyrestart sudo dd if=/mnt/vm-share/images/restartrestartrestart jboss/jboss_ctrl_root.img of=/dev//usr/bin/kvm/usr/bin/kvm test02/jboss_ctrl Copy the node xml le sudo cp /mnt/vm-share/images/jboss/ jboss_ctrl.xml /etc/libvirt/qemu/ jboss_ctrl.xml Edit jboss-ctrl.xml and change the name and update the drive locations to the lvm volumes Also change the network source to point at the new network create above ( in mnt/vm-share/images/ jboss and in /etc/libvirt/qemu), change the name for the le too,and delete the uuid.(the machine generate another one new for each node. martes 17 de agosto de 2010 16. Dene the VM, with the new name ( you should be change before) root@test02:/etc/libvirt/qemu# sudo virsh dene jboss_ctrl02.xm