CloudStack4.1.0 installation details-2. KVM

Source: Internet
Author: User
Tags cloudstack
CloudStack4.1.0 installation explanation-2. KVMKVM (kernel-basedVirtualMachine) is an open-source system virtualization platform. it has been integrated into the Linux kernel since Linux2.6.20, because it uses the Linux scheduler for management, so the opposite virtualization solution... cloudStack 4.1.0 installation details-2. KVM (kernel-based Virtual Machine) is an open-source system virtualization platform. it has been integrated into the Linux kernel since Linux 2.6.20, because it uses the Linux scheduler for management, its core source code is rarely more stable than the virtualization solution. CloudStack supports integration with multiple virtualization solutions. CloudStack + KVM is the best combination of gold! They are all powerful and free of charge. you can freely deploy and install them without fear of asking for authorization fees. KVM has never been a good free cluster management tool. now, with CloudStack, powerful commercial software such as VCenter and XenCenter is no inferior. Today, we will introduce how to install CloudStack when the controlled end is a KVM node. In view of the large copy of online articles, a lot of content is loaded to install a lot of things, and the audience will be dizzy after a while. they don't know why these programs are installed and what they are doing. This time, I will explain each step in as much detail as possible, as well as the experience and lessons I have learned after multiple reinstalls, hoping that the latencies will be avoided. I. environment detection KVM virtualization requires hardware support. Therefore, you must first check whether your server can support it. if this step cannot be done, the following content does not need to be viewed again. Check Method: 1 egrep '^ flags. * (vmx | svm)'/proc/cpuinfo. if something is displayed after execution, congratulations, please continue with me. Let's go! 2. install KVM components CentOS to directly provide the KVM program source. 1yum install kvm kmod-kvm qemu kvm-qemu-img virt-viewer virt-manager libvirt vconfig thanks to Linux kernel support, KVM-related packages are not large, this step should be completed very quickly. To ensure that the management node can be called normally, you need to open relevant ports. Vi/etc/libvirt/lib1_d. remove the following comments in the conf file: 1listen_tls = 02listen_tcp = 13tcp_port = "16509" 4auth_tcp = "none" 5mdns_adv = 0vi/etc/sysconfig/lib1_d 1lib1_d_args = "-- listen" vi/etc/libvirt/qemu. conf 1vnc_listen = 0.0.0.0 now, you can start the VM service: 1 service lib1_d restart to test whether it is successful: 1 lsmod | grep kvm 3. install the NTP time synchronization management node to communicate with the controlled node through various protocols. to ensure security, the controlled node performs a series of verification after receiving the command, if the time of the two machines is not synchronized, the command will be rejected. Therefore, the simplest way is to install the NTP service on all machines to automatically synchronize time. Of course, if you can ensure that the time difference between the two machines is not big, this step can be ignored. Installation method 1 yum install ntp IV. Set host name CloudStack Management node to get the name of the controlled terminal when adding a host. Otherwise, the host cannot be properly added, when the Agent is started, a large number of errors are reported. Run the following command to check: 1 hostname -- fqdn if no normal response is returned, edit the/etc/hosts file and add the name corresponding to the host ip address. For example: 192.168.19.160 kvm1.cloudstack. comvi/etc/sysconfig/network. It takes effect immediately after editing. If not, restart the server. Note: when a controlled machine is added to CloudStack, the name is automatically entered. Therefore, do not be lazy. you must set different names for each machine. Otherwise, you will feel helpless when facing a bunch of hosts with the same name in the management background ~~~ 5. configure the yum repository. by default, the latest version of CloudStack is not included in the CentOS software source. to ensure smooth installation, you must manually specify the software source. Create the/etc/yum. repos. d/cloudstack. repo file with the following content: 1 [cloudstack] 2 name = cloudstack3baseurl = http://cloudstack.apt-get.eu/rhel/4.1/4enabled=15gpgcheck=0 6. installing agentKVM is not as powerful as XenServer, VCenter, and other built-in management functions. Therefore, you must install a CloudStack agent to complete the commands sent from the master. Install 1yum install cloud-agent directly through the repository. the installation package is relatively large. if your network is a small pipe, you can take a cup of tea and take a rest. Note: after the cloud-agent is installed, it does not need to be started. it is automatically started when a host is added to the management node. The default installation directory:/etc/cloudstack/agent CloudStack outputs logs through log4j, so you can adjust the log output structure by modifying the log4j-cloud.xml file. 7. modifying the default SELinux security policy of the security policy limits the CloudStack operation. Therefore, you need to adjust the following settings: vi/etc/selinux/config 1 SELINUX = permissive. the modification takes effect only after the server is restarted, to make the settings take effect immediately, use the following command 1 setenforce permissive to open some ports in iptables: 1 iptables-I input-p tcp-m tcp -- dport 22-j ACCEPT2iptables-I input-p tcp-m tcp -- dport 1798-j ACCEPT3iptables-I INPUT-p tcp-m tcp -- dport 16509-j ACCEPT4iptables-I INPUT-p tcp-m tcp -- dport 5900: 6100-j ACCEPT5iptables -I INPUT-p tcp-m tcp -- dport 49152: 49216-j ACCEPT6 7iptables-save>/etc/sysconfig/iptables 8. the host has been added. so far, your preparation has been completed. If you create a simple network domain, you can now add this controlled host to WEBUI of the management node. The operation method in this step is very simple. there is a very friendly wizard in CloudStack, which should help you complete the addition correctly. In addition, there are a lot of articles on the Internet that I will not elaborate on. I will introduce the functions and adding methods of CloudStack advanced network domains when I have the opportunity in the future. Appendix, possible problems: 1. adding a host to the management node fails. if it is unfortunate that the host fails to be added, please do not panic. this problem should not be hard to solve. check the log first. Manage node logs in/var/log/cloudstack/management/catalina. out controlled node log in:/var/log/cloudstack/agent/cloudstack-agent.out carefully and repeatedly analyze the log, you will find the answer, and then raise the level of sublimation ~~~ 2. Unable to start agent: Failed to get private nic name. if you are a beginner, do not select a network. In particular, do not randomly specify traffic labels. In CloudStack, the traffic label is related to the bridge of the controlled host. if the traffic label is set, the controlled host must set the corresponding Bridge. When the cloudstack4.1 agent is started, two bridges, cloudbr0 and cloudbr1, are automatically created by default. If you specify other tag names, the corresponding Bridge also needs to be modified. you even need to manually create a bridge on the controlled machine. To change the name of another bridge, you must specify vi/etc/cloudstack/agent in the configuration file. properties: modify the following two parameters: 1private. network. device2public. network. if a bridge error is specified for devic, the preceding error occurs. If you really understand this truth, you can proceed to the advanced level. you will be able to use different networks for different NICs. 3. Failed to create vnet if you try to create an advanced network, the above error occurs because you have not installed the vconfig program. 1yum install vconfig
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.