blue=`tput setaf 4`
red=`tput setaf 1`
green=`tput setaf 2`
-interface='enp7s0'
+private_interface='enp6s0'
+public_interface='enp8s0'
pxe_bridge='pxebr'
fuel_gw_ip='10.20.0.1/16'
##END VARS
}
setup_pxe_bridge() {
- #Check whether base interface exists
- echo "${blue}Checking whether base interface ${interface} exists${reset}"
- if ! ip link show ${interface}; then
- echo "${red}Base interface ${interface} does not exists!${reset}"
+ #Check whether private interface exists
+ echo "${blue}Checking whether private interface ${private_interface} exists${reset}"
+ if ! ip link show ${private_interface}; then
+ echo "${red}Private interface ${private_interface} does not exists!${reset}"
exit 1
else
echo "${green}OK!${reset}"
fi
- #Check whether base interface is UP
- check_interface ${interface}
+ #Check whether private interface is UP
+ check_interface ${private_interface}
pxe_vid=0
- pxe_interface="${interface}.${pxe_vid}"
+ pxe_interface="${private_interface}.${pxe_vid}"
#Check whether VLAN 0 (PXE) interface exists
echo "${blue}Checking whether VLAN 0 (PXE) interface ${pxe_interface} exists${reset}"
if ! ip link show ${pxe_interface}; then
echo "${blue}Creating VLAN 0 (PXE) interface ${pxe_interface}${reset}"
- ip link add link ${interface} name ${pxe_interface} type vlan id ${pxe_vid}
+ ip link add link ${private_interface} name ${pxe_interface} type vlan id ${pxe_vid}
else
echo "${green}OK!${reset}"
fi
echo "${green}OK!${reset}"
fi
}
+###check whether access to public network is granted
+check_access_enabled_to_public_network() {
+ #Check whether public interface exists
+ echo "${blue}Checking whether public interface ${public_interface} exists${reset}"
+ if ! ip link show ${public_interface}; then
+ echo "${red}Public interface ${public_interface} does not exists!${reset}"
+ exit 1
+ else
+ echo "${green}OK!${reset}"
+ fi
+
+ #Check whether public interface ${public_interface} is UP
+ check_interface ${public_interface}
+
+ echo "${blue}Checking whether access is granted to public network through interface ${public_interface}${reset}"
+ if ! sudo iptables -t nat -L POSTROUTING -v | grep "MASQUERADE.*${public_interface}.*anywhere.*anywhere"; then
+ echo "${blue}Enable access to public network through interface ${public_interface}${reset}"
+ iptables -t nat -A POSTROUTING -o ${public_interface} -j MASQUERADE
+ else
+ echo "${green}OK!${reset}"
+ fi
+}
##END FUNCTIONS
main() {
load_kvm_kernel_mod
start_libvirtd_service
setup_pxe_bridge
+ check_access_enabled_to_public_network
}
main "$@"
blade_node_file = '%s/%s' % (
self.work_dir, os.path.basename(self.blade_node_file))
with self.ssh as s:
- status = s.run('python %s %s %s %s'
- % (('-nh' if self.no_health_check else ''),
- deploy_app, dea_file, blade_node_file))
+ status = s.run(
+ 'python %s %s %s %s' % (
+ deploy_app, ('-nh' if self.no_health_check else ''),
+ dea_file, blade_node_file))
return status
def check_supported_release(self):
nodes:
- id: 1
- pxeMac: 00:25:B5:A0:00:2A
+ pxeMac: 00:25:b5:a0:00:2a
ipmiIp: 172.30.8.75
ipmiUser: admin
ipmiPass: octopus
- id: 2
- pxeMac: 00:25:B5:A0:00:3A
+ pxeMac: 00:25:b5:a0:00:3a
ipmiIp: 172.30.8.65
ipmiUser: admin
ipmiPass: octopus
- id: 3
- pxeMac: 00:25:B5:A0:00:4A
+ pxeMac: 00:25:b5:a0:00:4a
ipmiIp: 172.30.8.74
ipmiUser: admin
ipmiPass: octopus
- id: 4
- pxeMac: 00:25:B5:A0:00:5A
+ pxeMac: 00:25:b5:a0:00:5a
ipmiIp: 172.30.8.73
ipmiUser: admin
ipmiPass: octopus
- id: 5
- pxeMac: 00:25:B5:A0:00:6A
+ pxeMac: 00:25:b5:a0:00:6a
ipmiIp: 172.30.8.72
ipmiUser: admin
ipmiPass: octopus