-
Notifications
You must be signed in to change notification settings - Fork 4
/
Openstack Virtual setup
132 lines (94 loc) · 5.44 KB
/
Openstack Virtual setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
++++++++++++++
BAREMETAL NODE
++++++++++++++
1. Configure the repositories on baremetal node. Various repos are available @ http://vault.gsslab.pnq.redhat.com/vault/jaison/
# rm -rf /etc/yum.repos.d/* << Delete the beaker repositories.
# curl http://vault.gsslab.pnq.redhat.com/vault/jaison/osp8.repo > /etc/yum.repos.d/osp9.repo
# yum install lftp wget -y
# yum install virt-manager dejavu-sans-fonts firefox xorg-x11-xauth instack-undercloud openvswitch net-tools virt-install libvirt libguestfs-tools-c nfs-utils -y
# systemctl stop NetworkManager
# systemctl disable NetworkManager
# for i in libvirtd openvswitch ; do systemctl restart $i ; done
# echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
# sysctl -p
2. Add stack user and give the sudo priviledges.
# useradd stack
# echo root123 | passwd stack --stdin
# echo "stack ALL=(root) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/stack
# chmod 0440 /etc/sudoers.d/stack
# sed -i 's/Defaults requiretty/Defaults !requiretty/' /etc/sudoers
3. create a soft link so that space should be sufficient for overcloud setup.
# rm -rf /var/lib/libvirt/images
# mkdir /home/images
# ln -s /home/images /var/lib/libvirt/images
4. Configure the openvswitch to provide network for overcloud and undercloud deployment.
# ovs-vsctl add-br vswitch
# ovs-vsctl add-port vswitch external tag=10 -- set Interface external type=internal
# ovs-vsctl add-port vswitch storage tag=20 -- set Interface storage type=internal
# ovs-vsctl add-port vswitch api tag=30 -- set Interface api type=internal
# ovs-vsctl add-port vswitch storage_mgmt tag=40 -- set Interface storage_mgmt type=internal
# ovs-vsctl add-port vswitch tenant tag=50 -- set Interface tenant type=internal
# ifconfig external 10.11.48.254/24
# ifconfig api 192.168.124.254/24
# ifconfig tenant 192.168.123.254/24
# ifconfig storage_mgmt 192.168.128.254/24
# ifconfig storage 192.168.125.254/24
5. As a stack user, download the image and configure the image and repo as environment variable.
$ wget http://vault.gsslab.pnq.redhat.com/vault/jaison/images/rhel-guest-image-7.2-20160302.0.x86_64.qcow2
$ export DIB_LOCAL_IMAGE=/home/stack/rhel-guest-image-7.2-20160302.0.x86_64.qcow2
$ export DIB_YUM_REPO_CONF=/etc/yum.repos.d/osp8.repo
$ export NODE_COUNT=5
IMP : Node count 5 means, it will create 6 KVMs, one for the undercloud and rest KVMs for overcloud setup.
We can use 3 as controller nodes and 2 as compute nodes. Adjust the memory of undercloud and overcloud nodes.
$ instack-virt-setup
++++++++++++
INSTACK NODE
++++++++++++
IMP : Above will command do the setup of undercloud and five overcloud nodes.
6. Login into "instack" node and configure the same repository which we have configured in Step 1.
[root@instack ~]# ll /etc/yum.repos.d/osp8.repo
-rw-r--r--. 1 root root 805 Aug 15 04:51 /etc/yum.repos.d/osp8.repo
[root@instack ~]# yum install -y wget python-rdomanager-oscplugin
7. Switched to stack user and start the intallation of undercloud. It will take 15-20 mins approx.
$ openstack undercloud install | tee undercloud_deployment.txt
8. Delete the flavors which are created by default except from baremetal flavor. Create new flavors for deployment.
$ for i in `nova flavor-list | grep -iv baremetal |grep True | cut -f2 -d\|` ; do nova flavor-delete $i ; done
$ openstack flavor create --id auto --ram 4000 --disk 40 --vcpus 2 control
$ openstack flavor create --id auto --ram 3000 --disk 40 --vcpus 1 compute
$ openstack flavor set --property "cpu_arch"="x86_64" --property "capabilities:boot_option"="local" --property "capabilities:profile"="control" control
$ openstack flavor set --property "cpu_arch"="x86_64" --property "capabilities:boot_option"="local" --property "capabilities:profile"="compute" compute
9. Install the packages which contain images.
$ sudo yum install rhosp-director-images rhosp-director-images-ipa -y
$ mkdir ~/images; cd ~/images
$ for i in `ls /usr/share/rhosp-director-images/*latest* ` ; do tar xvf $i ; done'
$ openstack overcloud image upload
$ neutron subnet-update 28984786-227e-47a2-a904-e9a4de7f1dad --dns-nameserver 192.168.122.1
10. As a root user. Needed for OSP 7/8 only.
# "cat > /usr/bin/bootif-fix << EOF
#!/usr/bin/env bash
while true;
do find /httpboot/ -type f ! -iname "kernel" ! -iname "ramdisk" ! -iname "*.kernel" ! -iname "*.ramdisk" -exec sed -i 's|{mac|{net0/mac|g' {} +;
done
EOF
chmod +x /usr/bin/bootif-fix
cat > /usr/lib/systemd/system/bootif-fix.service << EOF
[Unit]
Description=Automated fix for incorrect iPXE BOOFIF
[Service]
Type=simple
ExecStart=/usr/bin/bootif-fix
[Install]
WantedBy=multi-user.target
EOF
systemctl restart bootif-fix"
11. Importing the nodes in ironic DB and tagging the nodes.
$ openstack baremetal import --json instackenv.json
$ ironic node-list
$ openstack baremetal configure boot
$ ironic node-update f213f475-71a9-4d4e-8257-e3a0d589e74c replace properties/capabilities="profile:control,boot_option:local"
$ ironic node-update b9e5a7a0-4efe-4460-9a3f-87e27abb25b4 replace properties/capabilities="profile:compute,boot_option:local"
Add the extra NIC to overcloud nodes by issuing the command on baremetal node :
# for i in `virsh list --all --name | grep baremetalbrbm ` ; do virsh attach-interface --domain $i --type bridge --source vswitch --model virtio --config; virt-xml $i --edit 2 --network virtualport_type=openvswitch ; done
12. Start the introspection.
$ openstack baremetal introspection bulk start
## Create the templates for the deployment and ran the deployment script.