1. 程式人生 > >OpenStack學習

OpenStack學習

control tree umount openstac ftpd extras check serve tar

1.準備工作

rm -rf /etc/yum.repos.d/*
mount /dev/cdrom /mnt
cat >> /etc/yum.repos.d/aa.repo <<EOF
[aa]
name=aa
baseurl=file:///mnt
enabled=1
gpgcheck=0
EOF

yum install openvmtool bash vim lrzsz wget tree vsftpd createrepo -y

2修改主機名,修改host

hostnamectl controller.rhce.cc
echo ‘192.168.26.60 controller.rhce.cc‘ >> /etc/hosts

3防火墻及linux

firewall-cmd --set-default-zone=trusted
sed -i ‘/SELINUX=/cSELINUX=disabled‘ /etc/selinux/config
setenforce 0

4關閉NetworkManager

systemctl stop NetworkManager
systemctl disable NetworkManager

5創建目錄及拷貝鏡像

mkdir /var/ftp/{update,osp10,extras,common,dvd}
mkdir /osp #拉入鏡像

6永久掛載

echo "/osp/rhel-7-server-extras-20170308.iso /var/ftp/extras iso9660 defaults 0 0 ">> /etc/fstab
echo "/osp/rhel-7.3-server-updates-20170308.iso /var/ftp/update iso9660 defaults 0 0 " >> /etc/fstab
echo "/osp/rhel-7-server-rh-common-20170308.iso /var/ftp/common iso9660 defaults 0 0 " >> /etc/fstab
echo "/dev/cdrom /var/ftp/dvd iso9660 defaults 0 0 " >> /etc/fstab
mount -a
mkdir /xx
mount /osp/RHEL7OSP-10.0-20170309.3-x86_64.iso /xx
cp -rf /xx/* /var/ftp/osp10
umount /xx
cp /osp/rhel-guest-image-7-7.3-35.el7_3.noarch.rpm /var/ftp/osp10
createrepo -v /var/ftp/osp10/
systemctl restart vsftpd
systemctl enable vsftpd

7配置yum源

rm -rf /etc/yum.repos.d/*
cat >> /etc/yum.repos.d/bb.repo <<EOF
[dvd]
name=dvd
baseurl=ftp://192.168.26.60/dvd
enabled=1
gpgcheck=0

[update]
name=update
baseurl=ftp://192.168.26.60/update
enabled=1
gpgcheck=0

[extras]
name=extras
baseurl=ftp://192.168.26.60/extras
enabled=1
gpgcheck=0

[common]
name=common
baseurl=ftp://192.168.26.60/common
enabled=1
gpgcheck=0

[osp10]
name=osp10
baseurl=ftp://192.168.26.60/osp10
enabled=1
gpgcheck=0
EOF

8安裝軟件

yum install openstack-packstack -y

9創建應答文件

packstack --gen-answer-file=aa.txt

10修改應答文件

sed -i ‘/^CONFIG_PROVISION_DEMO=/cCONFIG_PROVISION_DEMO=n‘ aa.txt
sed -i.bak -r ‘s/(.+_PW)=[0-9a-z]+/\1=redhat/‘ aa.txt #修改密碼

11運行應答文件

packstack --answer-file=aa.txt

OpenStack學習