VMware system clone and vmware clone

Source: Internet
Author: User
Tags i18n aliyun

VMware system clone and vmware clone
Chapter 2 setting up a VMware environment 1st vmware Host Configuration-network configuration 1.1.1 adding Nic information to a VM (5)

A. Right-click the VM and choose "Settings"> "add virtual Nic hardware device ".

B. Set the network adapter type → finish adding

1.1.2 configure Nic information for the VM (6)

A. edit the virtual network editor → modify the VMnet8 configuration of the virtual network card → select NAT mode → disable DHCP

B. NAT settings → set network segment information 10.0.0.0/24

C. Set eth0 for the first Nic → NAT Mode

D. Set the second Nic eth1 → select the LAN segment

E. Add lan cidr blocks → 172.16.1.0/24 → OK to save

Set the server's internal LAN information-that is, the internal LAN is represented by the segment name, and the host with the same segment name is represented in a LAN

1.1.3 set the NIC address for the VM (5)

A. Configure eth0 information for the first Nic

B. Create a device → select "Ethernet"

C. Configure the eth1 information of the second Nic → save and exit

D. Restart and verify the NIC

-1 [root @ oldboyedu-40 ~] #/Etc/init. d/network restart 2 3 Shutting down interface eth0: [OK] 4 5 Shutting down interface eth1: [OK] 6 7 Shutting down loopback interface: [OK] 8 9 Bringing up loopback interface: [OK] 10 11 [root @ oldboyedu-40 ~] # Ifconfig 12 13 eth0 (Internet Nic) 14 15 10.0.0.200/24 16 17 10.0.0.254 18 19 223.5.5.5/223.6.6.6 20 21 eth1 (intranet Nic) 22 23 172.16.1.200/24

E. Use xshell to connect to the Virtual Machine

1.2 vmware Host Configuration-System Optimization Configuration 1.2.1 get base and epel yum source (software downloaded from abroad by default)
1 mv/etc/yum. repos. d/CentOS-Base.repo/etc/yum. repos. d/CentOS-Base.repo.backup # Back Up 2 3 wget-O/etc/yum. repos. centOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo4 5 wget-O/etc/yum. repos. d/epel. repo http://mirrors.aliyun.com/repo/epel-6.repo # Extend yum source 6 7-O specify the path to which the downloaded information is saved
1.2.2 disable SElinux
1 sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config2 3 grep SELINUX=disabled /etc/selinux/config4 5 setenforce 06 7 getenforce
1.2.3 disable iptables

1/etc/init. d/iptables stop 2 3 chkconfig iptables off

Disable the iptables service and enable auto-start upon startup

1.2.4 streamline boot self-starting services
1 chkconfig|awk '$1!~/crond|sshd|network|rsyslog|sysstat/{print "chkconfig",$1,"off"}'|bash2 3 export LANG=en4 5 chkconfig --list|grep 3:on

Disable useless services to reduce performance loss

1.2.5 Privilege Escalation oldboy can be sudo (optional)
 1 useradd oldboy 2  3 echo 123456|passwd --stdin oldboy 4  5 cp /etc/sudoers /etc/sudoers.ori 6  7 echo "oldboy ALL=(ALL) NOPASSWD:ALL ">>/etc/sudoers 8  9 tail -1 /etc/sudoers10 11 visudo -c
1.2.6 Chinese character set (negligible)
1 cp /etc/sysconfig/i18n /etc/sysconfig/i18n.ori2 3 echo 'LANG="zh_CN.UTF-8"' >/etc/sysconfig/i18n4 5 source /etc/sysconfig/i18n6 7 echo $LANG
1.2.7 Time Synchronization
1 echo '#time sync by oldboy at 2017-10-1' >>/var/spool/cron/root2 3 echo '*/5 * * * * /usr/sbin/ntpdate time.nist.gov >/dev/null 2>&1' >>/var/spool/cron/root4 5 crontab -l
1.2.8 Command Line Security (cannot be configured)
1 echo 'export TMOUT=300' >>/etc/profile2 3 echo 'export HISTSIZE=5' >>/etc/profile4 5 echo 'export HISTFILESIZE=5' >>/etc/profile6 7 tail -3 /etc/profile8 9 . /etc/profile
1.2.9 add file description Service

1 echo '*-nofile 65535'>/etc/security/limits. conf 2 3 tail-1/etc/security/limits. conf

1.2.10 kernel Optimization
1 cat>/etc/sysctl. conf <EOF 2 3 net. ipv4.tcp _ fin_timeout = 2 4 5 net. ipv4.tcp _ tw_reuse = 1 6 7 net. ipv4.tcp _ tw_recycle = 1 8 9 net. ipv4.tcp _ syncookies = 110 11 net. ipv4.tcp _ keepalive_time = 60012 13 net. ipv4.ip _ local_port_range = 4000 6500014 15 net. ipv4.tcp _ max_syn_backlog = 1638416 17 net. ipv4.tcp _ max_tw_buckets = 3600018 19 net. route 4.route. gc_timeout = 10020 21 net. ipv4.tcp _ syn_retries = 122 23 net. ipv4.tcp _ synack_retries = 124 25 net. core. somaxconn = 1638426 27 net. core. netdev_max_backlog = 1638428 29 net. ipv4.tcp _ max_orphans = 1638430 31 # The following parameters are used to optimize the iptables firewall. If the firewall does not have a meeting prompt, ignore 32 33 net. nf_conntrack_max = 2500000034 35 net. netfilter. nf_conntrack_max = 2500000036 37 net. netfilter. nf_conntrack_tcp_timeout_established = 18038 39 net. netfilter. nf_conntrack_tcp_timeout_time_wait = 12040 41 net. netfilter. nf_conntrack_tcp_timeout_close_wait = 6042 43 net. netfilter. nf_conntrack_tcp_timeout_fin_wait = 12044 45 EOF

1 sysctl-p # Make the parameters in the Kernel configuration file take effect

1.2.11 download and install Basic System Software

1 yum install lrzsz nmap tree dos2unix nc-y

1.2.12 system upgrade operation (skip this step)
1 yum update or yum upgrade2 3 yum-y update # upgrade all packages, change software and system settings, and upgrade the system kernel 4 5 yum-y upgrade # upgrade all packages, the software and system settings are not changed. The system version is upgraded but the kernel is not changed.
1.3 script processing skills for model Board Optimization 1.3.1 A. Modify host name and IP address script (not used)
1 [root @ backup ~] # Cat/server/scripts/m. sh 2 3 #! /Bin/sh 4 5 if [$ #-ne 2]; then 6 7 echo "/bin/sh $0 hostname PartIP" 8 9 exit 110 11 fi12 13 sed-I "s # oldboy #$1 # g"/etc/sysconfig/network14 15 hostname $116 17 sed-I "s #100 #$2 # g"/etc/sysconfig/network-scripts/ifcfg-eth018 19 sed-I "s #100 #$2 # g "/etc/sysconfig/network-scripts/ifcfg-eth120 21 # adjust the normal configuration of the cloned website 22 [root @ backup ~] # Tail-1/etc/rc. local23 24>/etc/udev/rules. d/70-persistent-net.rules25 26 # Delete the template and the mac row and uuid row in the NIC Configuration
1.3.2 B. Analysis and configuration of the module machine (used)

Host Parsing

 1 cat >/etc/hosts<<EOF 2  3 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 4  5 ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 6  7 172.16.1.5      lb01 8  9 172.16.1.6      lb0210 11 172.16.1.7      web0212 13 172.16.1.8      web0114 15 172.16.1.9      web0316 17 172.16.1.51     db01 db01.etiantian.org18 19 172.16.1.31     nfs0120 21 172.16.1.41     backup22 23 172.16.1.61     m0124 25 EOF
Chapter 2 configure VMware system clone 2.1 system preparation before cloning (for centos6 only)

2. perform the following operations in xshell to prevent you from using setup to modify the NIC. Otherwise, the MAC address will appear again.

2. setup cannot complete Nic configuration, mainly related to Character Set settings

2.1.1 clear (NIC rule configuration file ):
1>/etc/udev/rules. d/70-persistent-net.rules # contains the MAC address and other information of the Network Adapter. 2 3 echo '>/etc/udev/rules. d/70-persistent-net.rules '>/etc/rc. local # automatically clear after startup
2.1.2 Delete (UUID and HWADDR [MAC] information in the NIC configuration file ):

1 sed-ri '/HWADDR | UUID/D'/etc/sysconfig/network-scripts/ifcfg-eth [01] 2 3 cat/etc/sysconfig/network-scripts/ifcfg -eth [01]

# Delete and view the configuration files of eth0 and eth1 at the same time

2.1.3 clone the system

① Shutdown the model board-h now (taking a snapshot)

② Right-click → manage → clone

③ Next step

④ Default → next step

⑤ Create a link clone

⑥ Select the installation address → complete

2.2 vmware Host Configuration-set clone host rsync2.2.1 NIC address Modification
1>/etc/udev/rules. d/70-persistent-net.rules # contains the MAC address and other information of the Network Adapter. 2 3 echo '>/etc/udev/rules. d/70-persistent-net.rules '>/etc/rc. local # automatically clear after startup
2.2.2 modify system Host Name

1 hostname backup 2 3 sed-I's # oldboyedu-40 # backup # G'/etc/sysconfig/network 4 5 grep "backup"/etc/sysconfig/network

2.2.3 restart the network

1/etc/init. d/network restart

2.2.4 re-establish an xshell tag for connection

At this point, the host cloning is complete, and you can reconnect to the backup server.

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.