XenServer simulates gigabit network card
VMs have been installed with XenServer in the past two days. One of them is a Linux Server used for diskless testing and is not among the mainstream distributions. Unfortunately, XenServer recently did not support non-mainstream Linux. The two simulated online by default are Realtek Semiconductor. Co. RTL 8139/8139C, but VM Linux Server does not support this. After a long time of struggle, there is no NIC in the VM (Network Interface Cards).
The solution was found here at night:/articles/open-source-howtos/citrix_e1000_gigabit
XenServer does not allow users to choose the type of online used by the VM, and the default online simulation for VM is RTL 8139 100-megabit network. XenServer uses QEMU to simulate client devices. One hidden function is to simulate gigabit network card, which can solve the performance bottleneck (bottleneck) that non-mainstream Linux distributions cannot be paravirtualized. Of course, it can also solve the problem I encountered. The original solution to this problem is as follows:
1. Execute the following command in XenServer:
# mv /usr/lib/xen/bin/qemu-dm /usr/lib/xen/bin/
2. Edit the new /usr/lib/xen/bin/qemu-dm in XenServer as follows:
1 #!/bin/bash 2 oldstring=$@ 3 newstring=${oldstring//rtl8139/e1000} 4 exec /usr/lib/xen/bin/ $newstring
3. Set the new qemu-dm to be executable and disable changes:
# chmod 755 /usr/lib/xen/bin/qemu-dm # chattr +i /usr/lib/xen/bin/qemu-dm
Note that the chattr command prevents qemu-dm from being changed, which can fail during upgrade. The solution is to execute chattr -i /usr/lib/xen/bin/qemu-dm before upgrading.
Multiple network cards are bound to XenServer
I personally feel that the xeconsole in XenServer 6.2 is not humanized, but the richness of the functions can be improved because the network management inside does not provide online binding functions.
After searching for some information, I found that the method of binding a network card in XenServer in bash is as follows:
1 root@xxx # <strong>xe pif-</strong><strong>list</strong> <strong># List physical network cards</strong> 2 uuid(RO) : <strong>UUID0 </strong> 3 device(RO) : eth0 4 currently-attached(RO) : true 5 VLAN(RO) : -1 6 network-uuid(RO) : N_UUID0 7 8 uuid(RO) : <strong>UUID1 </strong> 9 device(RO) : eth1 10 currently-attached(RO) : true 11 VLAN(RO) : -1 12 network-uuid(RO) : N_UUID1 13 root@xxx # <strong>xe network-create name-lable="bond0+1"</strong> <strong># Create a network card named bond0+1</strong>14 uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu <strong># Create a new network card </strong>UUID_bond15 root@xxx # <strong>xe bond-create network-uuid=UUID_bond pif-uuids=UUID0,UUID1 [mode=<balance-slb|active-backup>] </strong>16 root@xxx # <strong>xe network-list</strong> <strong># List network cards,Check whether the binding takes effect</strong>
The above mode=balance-slb|active-backup is two binding modes supported by XenServer. These two modes are about load balancing and failure protection. balance-slb is load balancing mode (Server Load Balance), that is, both network cards work, and active-backup is a redundant function in the failed protection mode, that is, the two network cards bound are one master and one backup. The default is balance-slb mode.
In fact, there are 7 modes for online binding, and you can learn about it if you have the chance in the future.
Set up virtual machine self-start
In earlier versions of XenServer (before 6.0), when starting XenServer, you can choose to automatically start the virtual machine installed there. This feature was cancelled by Citrix in XenServer 6.0 because it interferes with the compatibility of XenServer's HA (High Availability) and Failover (Failover) features. However, if you only run one XenServer, this function is still very good.
In XenServer 6.0, it is still possible to start the virtual machine automatically. This requires turning on the self-start function on the "Pool Level" and setting it using the command line on the virtual machine that needs to be self-start.
1 Get the UUID of the Pool
root@server# xe pool-list uuid ( RO) : <strong>POOL</strong><strong>-</strong><strong>UUID</strong> name-label ( RW) : TestPool name-description ( RW): master ( RO) : 74fc086b-8c89-4918-b69e-369fcb19847d default-SR ( RW) : bebb142a-d986-acac-d4f4-636de937d28b
2 Set the Pool's self-start
root@server# xe pool-param-set uuid=<strong>POOL-UUID</strong> other-config:auto_poweron=true
3 Get the UUID of the virtual machine that needs to be set to self-start (take the virtual machine with the name "W2K08" as an example)
root@server# xe vm-list name-label="W2K08" uuid ( RO) : <strong>VM</strong><strong>-</strong><strong>UUID</strong> name-label ( RW) : W2K08 power-state ( RO) : running
If you want to get the result of the introduction (i.e., you only want to output UUD), you can use the following command:
root@server# xe vm-list name-label="W2K08" params=uuid --minimal
4 Set up the virtual machine's self-start
root@server# xe vm-param-set uuid=<strong>VM-UUID</strong> other-config:auto_poweron=true
2015-05-30 append:
Local patch upload execution
# xe patch-upload ... # xe patch-list # xe patch-apply uuid=... host-uuid=...
Use local ISO as Storage Repository (SR)
# xe sr-create type=iso name-label="local isos" device-config:location=/folder-to-isos device-config:legacy_mode=true content-type=iso # mount iso locally first
The above is the detailed content of XenServer emulating a gigabit network card and binding multiple network cards. For more information about XenServer emulating a gigabit network card binding, please pay attention to my other related articles!