2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-12 17:30:19 +00:00
This commit is contained in:
bybai
2015-09-14 05:27:08 -04:00
parent e85523c35e
commit 0decb6aea9

View File

@ -4,7 +4,7 @@ Manage Virtual Machine (VMs)
Create the Virtual Machine
----------------------
In this doc, we assume the powerKVM hypervisor host node001 is ready to use.
In this doc, we assume the powerKVM hypervisor host cn1 is ready to use.
Create VM Node Definition
`````````````````````````
@ -29,9 +29,9 @@ Run the chdef command to change the following attributes for the vm1:
chdef vm1 vmcpus=2
2. Define the kvm hypervisor of the virtual machine vm1, it should be set to node001: ::
2. Define the kvm hypervisor of the virtual machine vm1, it should be set to cn1: ::
chdef vm1 vmhost=node001
chdef vm1 vmhost=cn1
3. Define the virtual memory size, the unit is Megabit. For example, to define 1GB of memory to vm1: ::
@ -68,9 +68,9 @@ Run the chdef command to change the following attributes for the vm1:
C. Create storage on a directory of hypervisor
Instead of he format is 'dir:/install/vms': ::
Instead of he format is 'dir:///var/lib/libvirt/images': ::
chdef vm1 vmstorage=dir:///install/vms
chdef vm1 vmstorage=dir:///var/lib/libvirt/images
Note: The attribute vmstorage is only necessary for diskfull node. You can ignore it for diskless node.
@ -146,7 +146,7 @@ Start VM Installation
rpower vm1 on
If the vm1 was powered on successfully, you can get following information when running 'virsh list' on the kvm hypervisor node001. ::
If the vm1 was powered on successfully, you can get following information when running 'virsh list' on the kvm hypervisor cn1. ::
virsh list
Id Name State
@ -178,7 +178,7 @@ You can use console in xcat management node or kvm hypervisor to monitor the pro
vm1: textconsole: /dev/pts/0
vm1: password: JOQTUtn0dUOBv9o3
vm1: vidproto: vnc
vm1: server: node001
vm1: server: cn1
vm1: vidport: 5900
Note: Now just pick your favorite vnc client and connect to the hypervisor, using the password generated by "getrvidparms". If the vnc client complains the password is not valid, it is possible that your hypervisor and headnode clocks are out of sync! You can sync them by running "ntpdate <ntp server>" on both the hypervisor and the headnode.
@ -207,9 +207,9 @@ You can use console in xcat management node or kvm hypervisor to monitor the pro
Remove the virtual machine
------------------------
Remove the kvm1 even when it is in power on status. ::
Remove the vm1 even when it is in power on status. ::
rmvm mv1 -f
rmvm vm1 -f
Remove the definition of kvm and related storage. ::
@ -225,9 +225,9 @@ The node can NOT be run without the vm master if choosing to make the node attac
**In attaching mode**
In this mode, all the nodes will be attached to the vm master. Lesser disk space will be used than the general node.
Create the vm master kvmm from a node (vm1) and make the original node kvm2 attaches to the new created vm master: ::
Create the vm master vm5 from a node (vm1) and make the original node vm1 attaches to the new created vm master: ::
clonevm vm1 -t kvmm
clonevm vm1 -t vm5
vm1: Cloning vm1.sda.qcow2 (currently is 1050.6640625 MB and has a capacity of 4096MB)
vm1: Cloning of vm1.sda.qcow2 complete (clone uses 1006.74609375 for a disk size of 4096MB)
vm1: Rebasing vm1.sda.qcow2 from master
@ -237,24 +237,24 @@ After the performing, you can see the following entry has been added into the vm
tabdump vmmaster
name,os,arch,profile,storage,storagemodel,nics,vintage,originator,comments,disable
"kvmm","<os>","<arch>","compute","nfs://<storage_server_ip>/vms/kvm",,"br0","<date>","root",,
"vm5","<os>","<arch>","compute","nfs://<storage_server_ip>/vms/kvm",,"br0","<date>","root",,
Clone a new node vm2 from vm master kvmm: ::
Clone a new node vm2 from vm master vm5: ::
clonevm vm2 -b kvmm
clonevm vm2 -b vm5
**In detaching mode**
Create a vm master that the original node detaches with the created vm master. ::
clonevm vm2 -t kvmmd -d
clonevm vm2 -t vm6 -d
vm2: Cloning vm2.sda.qcow2 (currently is 1049.4765625 MB and has a capacity of 4096MB)
vm2: Cloning of vm2.sda.qcow2 complete (clone uses 1042.21875 for a disk size of 4096MB)
Clone the vm3 from the kvmmd with the detaching mode turn on: ::
Clone the vm3 from the vm6 with the detaching mode turn on: ::
clonevm vm3 -b kvmmd -d
vm3: Cloning kvmmd.sda.qcow2 (currently is 1042.21875 MB and has a capacity of 4096MB)
clonevm vm3 -b vm6 -d
vm3: Cloning vm6.sda.qcow2 (currently is 1042.21875 MB and has a capacity of 4096MB)
FAQ
---
@ -263,21 +263,21 @@ FAQ
**Issue**: One error as following message: ::
rpower kvm1 on
kvm1: internal error no supported architecture for os type 'hvm'
rpower vm1 on
vm1: internal error no supported architecture for os type 'hvm'
**Solution**: This error was fixed by restarting libvirtd on the host machine: ::
xdsh kvmhost1 service libvirtd restart
xdsh cn1 service libvirtd restart
Note: In any case that you find there is libvirtd error message in syslog, you can try to restart the libvirtd.
2, Virtual disk has problem
**Issue**: When running command 'rpower kvm1 on', get the following error message: ::
**Issue**: When running command 'rpower vm1 on', get the following error message: ::
kvm1: Error: unable to set user and group to '0:0'
on '/var/lib/xcat/pools/27f1df4b-e6cb-5ed2-42f2-9ef7bdd5f00f/kvm1.sda.qcow2': Invalid argument:
vm1: Error: unable to set user and group to '0:0'
on '/var/lib/xcat/pools/27f1df4b-e6cb-5ed2-42f2-9ef7bdd5f00f/vm1.sda.qcow2': Invalid argument:
**Solution**: try to figure out the ``nfs://<storage_server_ip>`` was exported correctly. The nfs client should have root authority.
@ -289,7 +289,7 @@ FAQ
4, rpower fails with "qemu: could not open disk image /var/lib/xcat/pools/2e66895a-e09a-53d5-74d3-eccdd9746eb5/vmXYZ.sda.qcow2: Permission denied" error message
**Issue**: When running rpower on a kvm vm, rpower complains with the following error message: ::
**Issue**: When running rpower on a vm, rpower complains with the following error message: ::
rpower vm1 on
vm1: Error: internal error Process exited while reading console log output: char device redirected to /dev/pts/1
@ -318,8 +318,8 @@ FAQ
**Solutoin**: This issue may be caused by the incorrect driver for vm. You can try to change driver to 'virtio' by following steps: ::
rmvm kvm1
chdef kvm1 vmnicnicmodel=virtio
mkvm kvm1
rmvm vm1
chdef vm1 vmnicnicmodel=virtio
mkvm vm1