使用VMware Workstation搭建先电IaaS2.4云平台(一)

简介: 使用VMware Workstation搭建先电IaaS2.4云平台

1、前期准备与说明

使用搭建openstack私用云平台的软件:VMware Workstation

使用的基础镜像:centos7.5.iso

使用搭建的iso镜像包:chinaskills_cloud_iaas.iso

网络模式选择:Flat直连模式


2、controller、compute硬件配置

【controller】

20201113221637713.png

【compute】

20201113221931978.png

20201113222013510.png

3、controller、compute节点IP地址配置情况

主机名 内部网络(仅主机模式) 外部网络(NAT模式)
controller 172.16.10.10 10.0.0.0/24 GW:10.0.0.1
compute 172.16.10.20 10.0.0.0/24 GW:10.0.0.1


【controller】

[root@controller ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
NAME=ens32
DEVICE=ens32
ONBOOT=yes
IPADDR=172.16.10.10
NETMASK=255.255.255.0
GATEWAY=172.168.10.1
[root@controller ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens34
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
NAME=ens34
DEVICE=ens34
ONBOOT=yes
[root@controller ~]# systemctl restart network
[root@controller ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:a7:1f:53 brd ff:ff:ff:ff:ff:ff
    inet 172.16.10.10/24 brd 172.16.10.255 scope global noprefixroute ens32
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fea7:1f53/64 scope link 
       valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:a7:1f:5d brd ff:ff:ff:ff:ff:ff
    inet6 fe80::20c:29ff:fea7:1f5d/64 scope link 
       valid_lft forever preferred_lft forever

【compute】

[root@compute ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
NAME=ens32
DEVICE=ens32
ONBOOT=yes
IPADDR=172.16.10.20
NETMASK-255.255.255.0
GATEWAY=172.16.10.1
[root@compute ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens34
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
NAME=ens34
DEVICE=ens34
ONBOOT=yes
[root@compute ~]# systemctl restart network
[root@compute ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:80:17:9e brd ff:ff:ff:ff:ff:ff
    inet 172.16.10.20/16 brd 172.16.255.255 scope global noprefixroute ens32
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe80:179e/64 scope link 
       valid_lft forever preferred_lft forever
3: ens34: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:80:17:a8 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::20c:29ff:fe80:17a8/64 scope link 
       valid_lft forever preferred_lft forever

4、修改主机名和主机名映射

【controller】

[root@controller ~]# hostnamectl set-hostname controller 
[root@controller ~]# su
[root@controller ~]# hostnamectl 
   Static hostname: controller
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 8ecc4e2d12224707b1d93f7a18706a30
           Boot ID: a4973aa4d65940baa24d801bc37c620a
    Virtualization: vmware
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-862.el7.x86_64
      Architecture: x86-64
[root@controller ~]# echo -e "172.16.10.10\tcontroller\\t172.16.10.20\tcompute" /etc/hosts
172.16.10.10    controller      172.16.10.20    compute /etc/hosts
[root@controller ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.10.10    controller
172.16.10.20    compute
[root@controller ~]# ping compute
PING compute (172.16.10.20) 56(84) bytes of data.
64 bytes from compute (172.16.10.20): icmp_seq=1 ttl=64 time=0.444 ms
64 bytes from compute (172.16.10.20): icmp_seq=2 ttl=64 time=2.73 ms
^Z
[1]+  Stopped                 ping compute
[root@controller ~]# 

【compute】

[root@compute ~]# hostnamectl set-hostname compute
[root@compute ~]# su
[root@compute ~]# hostnamectl 
   Static hostname: compute
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 8ecc4e2d12224707b1d93f7a18706a30
           Boot ID: 8ab9daac3ef8496bb52ee0893f152709
    Virtualization: vmware
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-862.el7.x86_64
      Architecture: x86-64
[root@compute ~]# echo -e "172.16.10.10\tcontroller\\t172.16.10.20\tcompute" /etc/hosts
172.16.10.10    controller      172.16.10.20    compute /etc/hosts
[root@compute ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.10.10    controller
172.16.10.20    compute
[root@compute ~]# ping controller
PING controller (172.16.10.10) 56(84) bytes of data.
64 bytes from controller (172.16.10.10): icmp_seq=1 ttl=64 time=0.222 ms
64 bytes from controller (172.16.10.10): icmp_seq=2 ttl=64 time=1.52 ms
^Z
[1]+  Stopped                 ping controller
[root@compute ~]# 

5、关闭防火墙和修改SELINUX模式

【controller|compute】

<<以controller为例>>

[root@controller ~]# systemctl stop firewalld
[root@controller ~]# systemctl disable firewalld
[root@controller ~]# setenforce 0
setenforce: SELinux is disabled
[root@controller ~]# sed  -i "s/SELINUX=enforcing/SELINUX=permissive/g" /etc/selinux/config 
[root@controller ~]# cat /etc/selinux/config 
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 
[root@controller ~]# 

6、配置本地YUM源

【controller】

[root@controller ~]# mkdir /opt/{centos,openstack}
[root@controller ~]# cd /etc/yum.repos.d/
[root@controller yum.repos.d]# ls
bak  http.repo
[root@controller yum.repos.d]# vi http.repo 
[root@controller yum.repos.d]# cat http.repo 
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
[openstack]
name=openstack
baseurl=file:///opt/openstack/iaas-repo
gpgcheck=0
enabled=1
[root@controller yum.repos.d]# 


【compute】

[root@compute ~]# cd /etc/yum.repos.d/
[root@compute yum.repos.d]# ll
total 4
drwxr-xr-x. 2 root root 187 Nov 14 17:46 bak
-rw-r--r--. 1 root root 181 Nov 14 17:46 http.repo
[root@compute yum.repos.d]# vi http.repo 
[root@compute yum.repos.d]# cat http.repo 
[centos]
name=centos
baseurl=http://172.16.10.10/opt/centos
gpgcheck=0
enabled=1
[openstack]
name=openstack
baseurl=http://172.16.10.10/opt/openstack/iaas-repo
gpgcheck=0
enabled=1
[root@compute yum.repos.d]# 
相关文章
|
28天前
|
Linux API 虚拟化
VMware WorkStation Pro 15.5(低版本安装) 教学用
VMware WorkStation Pro 15.5(低版本安装) 教学用
155 5
|
2月前
|
运维 虚拟化 Windows
VMware Workstation常见的故障处理
关于VMware Workstation常见故障处理的指南,包括Windows 10开启虚拟机蓝屏问题的解决方案和虚拟机无法开机时的解决方法。
208 21
VMware Workstation常见的故障处理
|
1月前
|
虚拟化 网络虚拟化 网络架构
虚拟机 VMware Workstation 16 PRO 的网络配置
虚拟机 VMware Workstation 16 PRO 的网络配置
|
2月前
|
虚拟化
VMware Workstation子网划分及bond配置案例
本文主要介绍了如何在VMware Workstation中进行子网划分以及如何添加和配置四块网卡以实现bond模式,并通过配置文件和命令行操作来验证bond模式的有效性。
68 2
VMware Workstation子网划分及bond配置案例
|
2月前
|
虚拟化
VMware Workstation产品常用的快捷键
文章介绍了VMware Workstation产品中常用的快捷键及其功能,包括对虚拟机的控制、设置、快照管理等操作,同时提供了作者的联系方式和博客链接。
159 15
|
4月前
|
虚拟化
VMware Workstation 16 Pro安装教程
VMware Workstation 16 Pro安装教程
157 1
|
5月前
|
Linux 调度 虚拟化
Linux系统——初识Linux、虚拟机介绍、VMware WorkStation安装、在VMware上安装Linux
Linux系统——初识Linux、虚拟机介绍、VMware WorkStation安装、在VMware上安装Linux
125 4
|
4月前
|
Linux 虚拟化
部署04-ncpa.cpl 虚拟机介绍,什么是虚拟机,怎样使用虚拟机,安装VMWARE,WorkStation,VMWARE这款软件是收费软件,可以在一个月期间进行使用,成功看VMWARE高级网络设置
部署04-ncpa.cpl 虚拟机介绍,什么是虚拟机,怎样使用虚拟机,安装VMWARE,WorkStation,VMWARE这款软件是收费软件,可以在一个月期间进行使用,成功看VMWARE高级网络设置
|
6月前
|
虚拟化 Windows
VMware Workstation 15 Pro 如何安装和使用
VMware Workstation 15 Pro 如何安装和使用
100 1
|
6月前
|
存储 Linux 虚拟化
VMware保姆级安装教程-VMware Workstation Pro 16(Windows10)
VMware保姆级安装教程-VMware Workstation Pro 16(Windows10)

热门文章

最新文章