Detailed guide to XenServer installation and virtual machine deployment

  • 2020-05-15 03:10:41
  • OfStack

1 understand the server configuration

1.1 see if the server CPU supports virtualization

1.1.1 the purpose

Currently, virtualization is supported in the mainstream CPU produced by Inter and AMD, but it is disabled by default on many computers or motherboards when BIOS leaves the factory

1.1.2 method

setp1: after restarting the server, press F2 or F10 to enter the BIOS interface (different motherboard models require different keys to enter BIOS)
setp2: switch the display of BIOS to the panel of Process. Since the main board is not the same, the key words in BIOS are not the same. The main purpose is to find Virtual or Virtualization and set it to Enabled
setp3: save the modified CPU virtualization Settings when exiting BIOS

1.2 view the server memory size
1.2.1 purpose

To rationalize the memory size of virtual machines deployed on the virtualization platform, take a look at the memory configuration of the server here

1.2.1 method
setp1: execute command: free-m
setp2: view the display results, as shown in this example, total: 65501, indicating that the server has 64G memory

1.3 view server CPU information
1.3.1 purpose
In order to reasonably allocate the number and audit of CPU to the virtual machines deployed on the virtualization platform;

1.3.1 method
setp1: execute command: cat /proc/cpuinfo |grep "physical" |sort| uniq-c
setp2: view the display results, as shown in this example, a total of 24 cores (two 12-core CPU)

1.4 view the server hard disk information
1.4.1 purpose

In order to reasonably allocate the virtual hard disk size to the virtual machine deployed on the virtualization platform;

1.4.1 method
setp1: execute command: df-Th
setp2: view the display results, as shown in this example 48T

Related software and image download

2.1 XenServer installation image download
2.1.1 purpose of download
Install the required image file for XenServer
2.1.2 download address
http://xenserver.org/overview-xenserver-open-source-virtualization/download.html
Version 2.1.3
XenServer-6.2.0-install-cd.iso
2.1.4 burn
Burn the XenServer-6.2.0-install-cd.iso image file to cd-rom.
2.2 XenCenter installation package download
2.2.1 download purpose
XenServer's client software is installed on windows machines that connect to the XenServer server network
2.2.2 download address
http://download.csdn.net/download/hvfdh/8270781
2.2.3 version
citrix xencenter 6.5

3 XenServer installation

Prepare so long, finally can install!!
3.1 installation steps
Basically, route 1 ok goes down, and the following points need to be noted:
setp1: start the server from the CD
setp2: note the details of selecting US for keyboard type and Shanghai for locale
setp3: note the choice of VirtualMachine Storage, 1 as the default, do not select the optimization mode
setp4: note the network and DNS Settings, according to the actual local network Settings
setp5: note that you do not choose to install the patch when installing type 1
3.2 installation XenCenter

XenCenter is the administrative client of XenServer, which can be used to manage XenServer and the virtual machines deployed on it.
XenCenter is installed on the windows machine which is connected to XenServer. The installation steps are simple and will not be repeated here.
Once the XenCenter installation is complete, you can connect to the XenServer server via the "add server" operation.
3.3 virtual machine deployment preparation

The installation of XenServer is relatively simple, but the deployment of virtual machine on XenServer is a little bit of trouble. Only unlike other virtualization platforms, XenServer separates the virtual machine installation image from other storage, so there is a little trouble. However, be careful, you will find so easy, haha, let's get started!
3.3.1 purpose of creating lv volume

The & # 9787; During the installation of XenServer, there was no operation of disk partition as usual installation system 1;
The & # 9786; Check the disk information after the installation of XenServer system. The result is as follows: there are 48T hard disks, but after the df-Th command, only 4G hard disk space is found, and the system files of XenServer have occupied 1.9G.
The & # 9787; So the problem is, to deploy the virtual machine on XenServer, the storage will be insufficient, leaving about 2G available storage space, basically can not fit 1 CentOS system image, how to break this?
The & # 9786; Haha, XenServer has the concept of a storage warehouse. The storage warehouse (SR-Storage Repositories) is used to store ISO or VDI.
The & # 9787; XenServer is designed to use Shared storage and can support FC SAN, ISCSI SAN,NFS3 storage types.
The & # 9786; To be able to store virtual images, first create an lv volume on the XenServer server to store the ISO images. Then build a storage warehouse for XenServer, which is specially used to store virtual machine installation images. Mount the newly created lv volume to the storage warehouse.
3.3.2 steps for creating a new lv volume
setp1: view the remaining space
Executive order: vgdisplay; It can be seen that VG Size is 40 TB, according to the existing lv partition Name Numbers for VG_XenStorage - a9c7a79c d34-4277-2805-4-3 bae47a473f8

setp2: see the region for details
Execute the command: lvdisplay VG_XenStorage d34 a9c7a79c - 4277-2805-4-3 bae47a473f8
setp3: new lv volume iso for 20G to hold virtual image files
Execute the command: lvcreate L GB 20 - n iso VG_XenStorage d34 a9c7a79c - 4277-2805-4-3 bae47a473f8
Display Logical volume "iso" created
setp4: check the area again
Execute the command: lvdisplay VG_XenStorage d34 a9c7a79c - 4277-2805-4-3 bae47a473f8
As you can see, the newly created iso logical volume is already displayed, with a size of 20GB
setp5: formats the logical volume you just created in ext3
Execute the command: mkfs ext3 / dev/VG_XenStorage - a9c7a79c d34-4277-2805-4-3 bae47a473f8 / iso
setp6: create the iso file in the root directory for mounting the ISO mirror file
Execute command: mkdir /iso
Transfer the virtual machine installation image to the /iso directory via Xshell
setp7: activate all volume groups
Execute command: vgchange -a y
Display 2 logical volume (s) in volume group "VG_XenStorage d34 a9c7a79c - 4277-2805-4-3 bae47a473f8" now active
setp8: mount the /iso folder
Execute the command: mount/dev/VG_XenStorage - a9c7a79c d34-4277-2805-4-3 bae47a473f8 / iso/iso
setp9: add auto mount to /etc/fstab
Execute command: vi /etc/fstab
Add: / dev/VG_XenStorage - a9c7a79c d34-4277-2805-4-3 bae47a473f8 / iso iso ext3 defaults 0 0
setp10: create SR in XenCenter
Executive order: xe sr-create name-label =iso_storage location= iso location location location location location
Show 6 bab3651 - e2ce - c490 - a00a - e2858ee2dfa3
setp11: perform xe toolstack -- restart
At this point, you can see the newly created SR iso_storage in the XenCenter properties directory; If you switch to the iso_storage storage directory, you can see the list of virtual machine image files uploaded to /iso in step6
The & # 9786; The & # 9786; At this point, the virtual machine is ready for deployment, and then the virtual machine is installed.

3.4 virtual machine deployment

The deployed virtual machine on XenServer can be quickly deployed using the virtual machine deployment template provided on XenCenter

* steps to install the virtual machine

setp1: select the template for the version of the virtual machine you want to install in XenCenter
As in this example installation: CentOS 6.5 64bit

setp2: select the virtual machine image path

Select the corresponding CentOS image file below iso_storage that you created earlier
setp3: configure the CPU, memory and other information of the virtual machine
setp4: after checking the configuration information of the virtual machine, you can install the virtual machine.
setp5: after the virtual machine is installed, install xenserver-tools. The purpose of installing xenserver-tools is to make it easy to view the performance curve information of cpu, memory, network and disk of the virtual machine in XenCenter.
Execute command: mount /dev/xvdd /mnt/
Execute the command: / mnt/Linux install sh
setp6: configure the network and other information of the new virtual machine

The & # 9786; The & # 9786; At this point, the deployment of CentOS virtual machine is over. The deployment steps of windos virtual machine are simpler and more convenient

Problems and solutions that may be encountered during operation

Problem 1: after restarting XenServer, the SR iso_storage that created love for you is not found

iso_storage and lv volumes iso failed to mount, just mount again

Problem 2: the Linux virtual machine cannot start the graphical interface

When installing Linux (CentOS in this case) on XenServer, there is no graphical interface installation. After searching the information, it is found that it is the compatibility problem of XenServer: since XenServer's own template was selected when creating the virtual machine, Other Media should be selected from the operating system template when creating the virtual machine.

Problem 3: the virtual machine inexplicably fails to start
The possible reason is that when creating a virtual machine, you can use Fast copy mode or Full copy mode


Related articles: