Add shared storage to the xenserver deployment of the recording series 04
Job Environment
Xenserver
OS: xenserver 6.2
Hostname: xsr01
IP: 192.168.0.241/24
Gateway: IP: 192.168.0.1/24
Hardware environment: Dell poweredge r720
NFS server
OS: centos 6.4
Hostname: nfs01
IP: 192.168.0.204/24
Gateway: IP: 192.168.0.1/24
Running software: NFS and rpcbind
1. About xenserver Storage
The xenserver installation process involves no partitioning. After the system is installed, you can check the disk status and find that even a 1 TB hard disk has only 4 GB space, in addition, xenserver system files have occupied 1.9 GB, with only 2 GB of space left. Even a centos6.5 system image cannot be stored. How can I install a virtual machine without saving the ISO image file? This is a headache for beginners.
So how does xenserver implement storage expansion? Introducing the concept of storage warehouse in xenserver, the storage warehouse (Sr-storage repositories) is used to store iso or VDI. Shared storage is officially recommended by Citrix. This is the original intention and goal of xenserver design, which is different from that of VMware. At present, xenserver supports three Storage types: fc San, iSCSI San, and NFS. Different Lun types are divided based on different virtualization types for use. Storage servers are involved here, which requires device costs.
The text mainly uses NFS as an example to explain how to add shared storage. The specific implementation is not difficult to perform, because most of the operations are performed on the xencenter interface.
The installation of xenserver is not described here.
2. Build an NFS server
First, let's take a look at what NFS is.
NFS is short for network file system, that is, Network File System. An agreement for the use of distributed file systems, developed by Sun, was published on April 9, 1984. The function is to allow different machines and operating systems to share individual data with each other through the network, so that applications can access data on server disks through the network on the client, it is a way to share disk files between Unix-like systems.
The basic principle of NFS is "allow different clients and servers to share the same file system through a group of RPC", which is independent of the operating system, allows different hardware and operating system systems to share files. By using NFS, users and programs can access files on the remote system just like accessing local files.
Next, we will start building an NFS server. It is very easy to be familiar with Linux.
In this case, the system information of the NFS server is as follows:
OS: centos release 6.4 (final)
IP: 192.168.0.204/24
Partition:/boot (500 m),/(50g),/Home (955g), swap (4G)
Note: In this case, the system is a virtual machine running on another xenserver. It is installed using the centos6.4 template in xenserver and adopts the default partitioning method. In this way, installation is minimized, and many software packages are not installed, including NFS, which requires manual installation, which is troublesome.
In Red Hat Linux/centos systems, NFS installation is very simple. Only two software packages are required. In general, NFS is installed as the default package of the system.
Nfs-utils-*: includes basic NFS commands and monitoring programs.
Rpcbind: supports Secure nfs rpc service connections (Note: This is a software package under centos6 and Portmap is used in centos 5)
We can understand the relationship between RPC and NFS in this way: NFS is a file system, while RPC is responsible for information transmission.
Run the following command to check whether NFS is installed,
# Rpm-Qa | grep NFS
# Rpm-Qa | grep rpcbind
If no software package required for NFS is installed in the current system, you need to install it manually and set it to start.
# Yum install rpcbind *
# Yum install nfs-utils -*
# Service rpcbind start
# Service NFS start
# Chkconfig rpcbind on
# Chkconfig NFS on
Create two ISO and data folders in the/home directory and share them through NFS. They are used as image storage warehouses of xenserver and Virtual Machine storage warehouses respectively.
# Mkdir-P/home/ISO
# Mkdir-P/home/Data
# Vi/etc/exports (Note: The content edited by the following two actions)
/Home/Data * (RW, sync, no_root_squash)
/Home/ISO * (RW, sync, no_root_squash)
# Exportfs-
Run the following command to view the sharing information. If a shared directory is listed, the sharing is successful.
# Showmount-e 192.168.0.204
Export list for 192.168.0.204:
/Home/Data *
/Home/ISO *
After the sharing settings are complete, open the relevant port in iptables (this is complicated), or directly close iptables (this is the simplest). Otherwise, the other party will not be able to access it.
3. Add NFS vhd
The following operations are performed on xencenter. Add the xsr01 host to xencenter.
Right-click the xsr01 host and select "new SR" from the pop-up menu. The "New Storage repository" dialog box is displayed, and relevant settings are made in it. As shown in.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/37/07/wKiom1Or6TKCKicGAACn6zUASjo614.jpg "Title =" 01.jpg" alt = "wkiom1or6tkckicgaacn6zuasjo614.jpg"/>
Select the NFS vhd type.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/37/06/wKioL1Or6V_ivtH7AADfSjDkdzc099.jpg "Title =" 02.jpg" alt = "wkiol1or6v_ivth7aadfsjdkdzc099.jpg"/>
Set a name for this Sr. The default name is used here.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/37/06/wKioL1Or6WqgAcsJAACgtoonumc068.jpg "Title =" 03.jpg" alt = "wkiol1or6wqgacsjaacgtoonumc068.jpg"/>
Enter the path of the NFS shared directory. Note that there is a colon in the middle.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/37/06/wKioL1Or6XSiQ_fEAAC70HdVZic316.jpg "Title =" 04.jpg" alt = "wkiol1or6xsiq_feaac70hdvzic1_.jpg"/>
After the file is successfully added, an item named "NFS Virtual Disk Storage" is added under xsr01 and automatically becomes the default local storage.
Select "NFS Virtual Disk Storage". On the right of the interface, you can view its capacity, storage content, logs, and other information on the "General, storage, and logs" tab.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/37/07/wKiom1Or6bry7b-0AAC7RUefZG4215.jpg "Title =" 05.jpg" alt = "wKiom1Or6bry7b-0AAC7RUefZG4215.jpg"/>
If the addition fails, the system prompts "the SR failed to complete the operation. Check your setting and try again.". Check the firewall.
4. Add NFS ISO
The procedure is similar to adding NFS vhd, as shown in.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/37/06/wKioL1Or6a2BdVuPAACgpSthISA432.jpg "Title =" 11.jpg" alt = "wkiol1or6a2bdvupaacgpsthisa432.jpg"/>
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/37/06/wKioL1Or6cfzVeLTAACfclCkM-A888.jpg "style =" float: none; "Title =" 12.jpg" alt = "wKioL1Or6cfzVeLTAACfclCkM-A888.jpg"/>
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/37/07/wKiom1Or6fWzRKGQAACNaMULL_I892.jpg "style =" float: none; "Title =" 13.jpg" alt = "wkiom1or6fwzrkgqaacnamull_i892.jpg"/>
On the "Storage" tab, we can see that there are two ISO images available in the ISO storage warehouse.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/37/06/wKioL1Or6cfj3YCBAADUUMSQAqk351.jpg "Title =" 14.jpg" style = "float: none;" alt = "wkiol1or6cfj3ycbaaduumsqaqk351.jpg"/>
5. Add CIFS ISO
CIFS. CIFS (Common Internet File System) is a network file system launched by Microsoft. In win OS, CIFS is integrated into the OS without additional software. All machines are equivalent and can assume a dual role as sever or client. In contrast, NFS requires that the client must install dedicated software.
NFS is transmission independent and can use TCP or UDP. CIFS is a network-connected sharing protocol that requires high reliability for network transmission. TCP/IP is usually used. NFS retains the format features of UNIX files, such as all users and groups. CIFS adopts the Windows OS style.
CIFS is rarely used in the production environment, but it is often used in the early stage of project deployment and some temporary operations. The following shows how to add cifs iso.
First, of course, there must be a server with Windows OS installed for file sharing.
In this case, the operating system of CIFS is the system of the xencenter in this case. It is a very common PC with the following information:
OS: Windows XP SP3
IP: 192.168.0.102/24
Gateway: IP: 192.168.0.1/24
Here, we will set the ISO folder under the e drive to share. This is the basic skill of it .. (Note: In this case, there is no domain control environment. If Windows XP is added to domain control, you also need to set access permissions here .)
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/37/06/wKioL1Or6fuToKWpAAFFjgA6Fd4074.jpg "Title =" 31.jpg" alt = "wkiol1or6futokwpaaffjga6fd4074.jpg"/>
The following operations are performed on xencenter. The procedure is similar to adding NFS vhd, as shown in.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/37/07/wKiom1Or6kShJFvqAACkN75T7ZI394.jpg "style =" float: none; "Title =" 32.jpg" alt = "wkiom1or6kshjfvqaackn75t7zi394.jpg"/>
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/37/06/wKioL1Or6hbBjS1mAACfi6v1Meo818.jpg "style =" float: none; "Title =" 33.jpg" alt = "wkiol1or6hbbjs1maacfi6v1meo818.jpg"/>
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/37/07/wKiom1Or6kTBD9O4AACrTLl3sJA011.jpg "style =" float: none; "Title =" 34.jpg" alt = "wkiom1or6ktbd9o4aacrtll3sja011.jpg"/>
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/37/06/wKioL1Or6haz0oh9AADbZq7UOFg060.jpg "Title =" 35.jpg" style = "float: none;" alt = "wkiol1or6haz0oh9aadbzq7uof1_60.jpg"/>
Note that the path is written differently from the NFS path. If Windows XP is added to domain control, enter the user name and password that are allowed to access. Of course, you can also use your wn XP local administrator account and password for verification.
Vi. Others
After the above operations are completed successfully, you can use the ISO image in "cifs iso library" or "nfs iso library" (such as centos6.4) as the system disk to install the system.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/37/06/wKioL1Or6nuA4ibxAAD9hrT1u6c015.jpg "Title =" 40.jpg" alt = "wkiol1or6nua4ibxaad9hrt1u6c015.jpg"/>
Virtual hard disks of virtual machines are stored in the "NFS Virtual Disk Storage" storage warehouse by default. Of course, you can also choose the local storage on xsr01 ".
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/37/07/wKioL1Or6qjgtj14AAD1svFPMzQ481.jpg "Title =" 41.jpg" alt = "wkiol1or6qjgtj14aad1svfpmzq481.jpg"/>
For a single machine, the storage is the same everywhere. However, if multiple xenserver hosts are used as resource pools and high availability operations such as xmotion are required, the powerful advantages of NFS shared storage are shown.
The creation, import, export, and Cloning of virtual machines are not described here.
This article from the "One Tree qingjin" blog, please be sure to keep this source http://sunshyfangtian.blog.51cto.com/1405751/1431292