Merge remote-tracking branch 'starlingx/master' into HEAD
Change-Id: I5d4cfa27334d5d8960db6e16294ad080e9efcaee Signed-off-by: Scott Little <scott.little@windriver.com>
This commit is contained in:
commit
b76576d5ac
|
@ -329,48 +329,18 @@ for line in $(cat $tarball_file); do
|
||||||
rm -rf $directory_name
|
rm -rf $directory_name
|
||||||
rm e6aef069b6e97790cb127d5eeb86ae9ff0b7b0e3.tar.gz
|
rm e6aef069b6e97790cb127d5eeb86ae9ff0b7b0e3.tar.gz
|
||||||
elif [ "$tarball_name" = "tss2-930.tar.gz" ]; then
|
elif [ "$tarball_name" = "tss2-930.tar.gz" ]; then
|
||||||
dest_dir=ibmtpm20tss-tss
|
download_package $tarball_url
|
||||||
for dl_src in $dl_source; do
|
if [ $? -ne 0 ]; then
|
||||||
case $dl_src in
|
|
||||||
$dl_from_stx_mirror)
|
|
||||||
url="$(url_to_stx_mirror_url "$tarball_url" "$distro")"
|
|
||||||
;;
|
|
||||||
$dl_from_upstream)
|
|
||||||
url="$tarball_url"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Error: Unknown dl_source '$dl_src'"
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
git clone $url $dest_dir
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
# Success
|
|
||||||
break
|
|
||||||
else
|
|
||||||
echo "Warning: Failed to git clone from '$url'"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ! -d $dest_dir ]; then
|
|
||||||
echo "Error: Failed to git clone from '$tarball_url'"
|
|
||||||
echo "$tarball_url" > "$output_log"
|
|
||||||
error_count=$((error_count + 1))
|
error_count=$((error_count + 1))
|
||||||
popd # pushd $output_tarball
|
popd # pushd $output_tarball
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
unzip_file=ibmtpm20tss-tss-52539cb81c811c973b26ed23fafd28a700b7cc78
|
||||||
pushd $dest_dir
|
zip_file="$unzip_file.zip"
|
||||||
branch=$util
|
unzip $zip_file
|
||||||
git checkout $branch
|
mv $unzip_file $directory_name
|
||||||
rm -rf .git
|
|
||||||
popd
|
|
||||||
mv ibmtpm20tss-tss $directory_name
|
|
||||||
tar czvf $tarball_name $directory_name
|
tar czvf $tarball_name $directory_name
|
||||||
rm -rf $directory_name
|
rm -rf $directory_name
|
||||||
popd # pushd $dest_dir
|
|
||||||
fi
|
fi
|
||||||
popd # pushd $output_tarball
|
popd # pushd $output_tarball
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -28,7 +28,7 @@ requests-toolbelt-0.5.1.tar.gz#requests-toolbelt-0.5.1#https://github.com/reques
|
||||||
rpm-4.14.0.tar.bz2#rpm-4.14.0#https://ftp.osuosl.org/pub/rpm/releases/rpm-4.14.x/rpm-4.14.0.tar.bz2#http##
|
rpm-4.14.0.tar.bz2#rpm-4.14.0#https://ftp.osuosl.org/pub/rpm/releases/rpm-4.14.x/rpm-4.14.0.tar.bz2#http##
|
||||||
swtpm-0.1.0-253eac5.tar.gz#swtpm-0.1.0#https://github.com/stefanberger/swtpm/tarball/1303be7d03294fb02204cb8242f366cbf0da076d#http##
|
swtpm-0.1.0-253eac5.tar.gz#swtpm-0.1.0#https://github.com/stefanberger/swtpm/tarball/1303be7d03294fb02204cb8242f366cbf0da076d#http##
|
||||||
!tpm-kmod-e6aef069.tar.gz#tpm#http://git.infradead.org/users/jjs/linux-tpmdd.git/snapshot/e6aef069b6e97790cb127d5eeb86ae9ff0b7b0e3.tar.gz#http_script#post-dl-script/tpm-kmod.sh
|
!tpm-kmod-e6aef069.tar.gz#tpm#http://git.infradead.org/users/jjs/linux-tpmdd.git/snapshot/e6aef069b6e97790cb127d5eeb86ae9ff0b7b0e3.tar.gz#http_script#post-dl-script/tpm-kmod.sh
|
||||||
!tss2-930.tar.gz#tss2-930#https://git.code.sf.net/p/ibmtpm20tss/tss#git#v930#
|
!tss2-930.tar.gz#tss2-930#https://sourceforge.net/code-snapshots/git/i/ib/ibmtpm20tss/tss.git/ibmtpm20tss-tss-52539cb81c811c973b26ed23fafd28a700b7cc78.zip#http##
|
||||||
spectre-meltdown-checker-0.37+-5cc77741.tar.gz#spectre-meltdown-checker#https://github.com/speed47/spectre-meltdown-checker/tarball/5cc77741af1d2f52140aa9f89339f56b6c4b6783#http##
|
spectre-meltdown-checker-0.37+-5cc77741.tar.gz#spectre-meltdown-checker#https://github.com/speed47/spectre-meltdown-checker/tarball/5cc77741af1d2f52140aa9f89339f56b6c4b6783#http##
|
||||||
puppet-boolean-22b726dd78b0a60a224cc7054aebbf28e9306f62.tar.gz#puppet-boolean#https://github.com/voxpupuli/puppet-boolean/tarball/22b726dd78b0a60a224cc7054aebbf28e9306f62#http##
|
puppet-boolean-22b726dd78b0a60a224cc7054aebbf28e9306f62.tar.gz#puppet-boolean#https://github.com/voxpupuli/puppet-boolean/tarball/22b726dd78b0a60a224cc7054aebbf28e9306f62#http##
|
||||||
puppet-dnsmasq-cff07e90890662972c97684a2baee964f68ff3ed.tar.gz#packstack/puppet/modules/dnsmasq/#https://github.com/procore/puppet-dnsmasq/tarball/cff07e90890662972c97684a2baee964f68ff3ed#http##
|
puppet-dnsmasq-cff07e90890662972c97684a2baee964f68ff3ed.tar.gz#packstack/puppet/modules/dnsmasq/#https://github.com/procore/puppet-dnsmasq/tarball/cff07e90890662972c97684a2baee964f68ff3ed#http##
|
||||||
|
@ -46,7 +46,7 @@ openstack-helm-9d72fe1a501bc609a875eebf7b6274e18600ed70.tar.gz#openstack-helm#ht
|
||||||
openstack-helm-infra-5d356f9265b337b75f605dee839faa8cd0ed3ab2.tar.gz#openstack-helm-infra#https://github.com/openstack/openstack-helm-infra/archive/5d356f9265b337b75f605dee839faa8cd0ed3ab2.tar.gz#http##
|
openstack-helm-infra-5d356f9265b337b75f605dee839faa8cd0ed3ab2.tar.gz#openstack-helm-infra#https://github.com/openstack/openstack-helm-infra/archive/5d356f9265b337b75f605dee839faa8cd0ed3ab2.tar.gz#http##
|
||||||
gnocchi-4.2.5.tar.gz#gnocchi-4.2.5#https://pypi.io/packages/source/g/gnocchi/gnocchi-4.2.5.tar.gz#http##
|
gnocchi-4.2.5.tar.gz#gnocchi-4.2.5#https://pypi.io/packages/source/g/gnocchi/gnocchi-4.2.5.tar.gz#http##
|
||||||
gnocchiclient-7.0.1.tar.gz#gnocchiclient-7.0.1#https://pypi.io/packages/source/g/gnocchiclient/gnocchiclient-7.0.1.tar.gz#http##
|
gnocchiclient-7.0.1.tar.gz#gnocchiclient-7.0.1#https://pypi.io/packages/source/g/gnocchiclient/gnocchiclient-7.0.1.tar.gz#http##
|
||||||
kubernetes-v1.12.1.tar.gz#kubernetes-1.12.1#https://github.com/kubernetes/kubernetes/archive/v1.12.1.tar.gz#http##
|
kubernetes-v1.12.3.tar.gz#kubernetes-1.12.3#https://github.com/kubernetes/kubernetes/archive/v1.12.3.tar.gz#http##
|
||||||
kubernetes-contrib-v1.12.1.tar.gz#kubernetes-contrib-1.12.1#https://github.com/kubernetes/contrib/tarball/4b2a8512a95611acb174bd306e501719ce70b1cf#http##
|
kubernetes-contrib-v1.12.1.tar.gz#kubernetes-contrib-1.12.1#https://github.com/kubernetes/contrib/tarball/4b2a8512a95611acb174bd306e501719ce70b1cf#http##
|
||||||
gorilla-mux-456bcfa82d672db7cae587c9b541463f65bc2718.tar.gz#gorilla-mux#https://github.com/gorilla/mux/archive/456bcfa82d672db7cae587c9b541463f65bc2718.tar.gz#http##
|
gorilla-mux-456bcfa82d672db7cae587c9b541463f65bc2718.tar.gz#gorilla-mux#https://github.com/gorilla/mux/archive/456bcfa82d672db7cae587c9b541463f65bc2718.tar.gz#http##
|
||||||
gorilla-context-08b5f424b9271eedf6f9f0ce86cb9396ed337a42.tar.gz#gorilla-context#https://github.com/gorilla/context/archive/08b5f424b9271eedf6f9f0ce86cb9396ed337a42.tar.gz#http##
|
gorilla-context-08b5f424b9271eedf6f9f0ce86cb9396ed337a42.tar.gz#gorilla-context#https://github.com/gorilla/context/archive/08b5f424b9271eedf6f9f0ce86cb9396ed337a42.tar.gz#http##
|
||||||
|
|
|
@ -71,33 +71,6 @@ are:
|
||||||
- VirtualBox
|
- VirtualBox
|
||||||
- Libvirt/QEMU
|
- Libvirt/QEMU
|
||||||
|
|
||||||
Directory Structure
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
Deployment directory hosts a total of 3 directories and 18 files::
|
|
||||||
|
|
||||||
$ tree -L 3 deployment/
|
|
||||||
deployment/
|
|
||||||
├── libvirt
|
|
||||||
│ ├── compute.xml
|
|
||||||
│ ├── controller_allinone.xml
|
|
||||||
│ ├── controller.xml
|
|
||||||
│ ├── destroy_allinone.sh
|
|
||||||
│ ├── destroy_standard_controller.sh
|
|
||||||
│ ├── install_packages.sh
|
|
||||||
│ ├── setup_allinone.sh
|
|
||||||
│ └── setup_standard_controller.sh
|
|
||||||
├── provision
|
|
||||||
│ ├── simplex_stage_1.sh
|
|
||||||
│ └── simplex_stage_2.sh
|
|
||||||
└── virtualbox
|
|
||||||
├── all_in_one.conf
|
|
||||||
├── serial_vm.sh
|
|
||||||
├── setup_vm.sh
|
|
||||||
├── standard_controller.conf
|
|
||||||
├── start_vm.sh
|
|
||||||
└── stop_vm.sh
|
|
||||||
|
|
||||||
Directory: libvirt
|
Directory: libvirt
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -107,18 +80,22 @@ identity:
|
||||||
- Controller All-in-one
|
- Controller All-in-one
|
||||||
- Controller
|
- Controller
|
||||||
- Compute
|
- Compute
|
||||||
|
- Storage
|
||||||
|
|
||||||
These nodes are used to create the virtual machines and the network interfaces
|
These nodes are used to create the virtual machines and the network interfaces
|
||||||
to setup the StarlingX system:
|
to setup the StarlingX system:
|
||||||
|
|
||||||
- Setup All-in-one
|
- Setup Simplex
|
||||||
|
- 1 Controller
|
||||||
|
- Setup Duplex
|
||||||
- 2 Controllers
|
- 2 Controllers
|
||||||
|
- Setup Controller Storage
|
||||||
- Setup Standard Controller
|
|
||||||
|
|
||||||
- 2 Controllers
|
- 2 Controllers
|
||||||
- 2 Computes
|
- 2 Computes
|
||||||
|
- Setup Dedicated Storage
|
||||||
|
- 2 Controllers
|
||||||
|
- 2 Computes
|
||||||
|
- 2 Storages
|
||||||
|
|
||||||
Directory: virtualbox
|
Directory: virtualbox
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
|
@ -23,7 +23,7 @@ The simplest way to handle this is to keep an rc file that can be sourced into
|
||||||
an interactive shell that configures everything. Here's an example::
|
an interactive shell that configures everything. Here's an example::
|
||||||
|
|
||||||
export CONTROLLER=madcloud
|
export CONTROLLER=madcloud
|
||||||
export COMPUTE=madnode
|
export WORKER=madnode
|
||||||
export BRIDGE_INTERFACE=madbr
|
export BRIDGE_INTERFACE=madbr
|
||||||
export EXTERNAL_NETWORK=172.30.20.0/24
|
export EXTERNAL_NETWORK=172.30.20.0/24
|
||||||
export EXTERNAL_IP=172.30.20.1/24
|
export EXTERNAL_IP=172.30.20.1/24
|
||||||
|
@ -48,14 +48,16 @@ Controllers
|
||||||
There is one script for creating the controllers: ``setup_configuration.sh``. It
|
There is one script for creating the controllers: ``setup_configuration.sh``. It
|
||||||
builds different StarlingX cloud configurations:
|
builds different StarlingX cloud configurations:
|
||||||
|
|
||||||
- allinone
|
- simplex
|
||||||
- standardcontroller
|
- duplex
|
||||||
|
- controllerstorage
|
||||||
|
- dedicatedstorage
|
||||||
|
|
||||||
You need an StarlingX ISO file for the installation. The script takes the
|
You need an StarlingX ISO file for the installation. The script takes the
|
||||||
configuration name with the ``-c`` option and the ISO file name with the
|
configuration name with the ``-c`` option and the ISO file name with the
|
||||||
``-i`` option::
|
``-i`` option::
|
||||||
|
|
||||||
./setup_configuration.sh -c allinone -i stx-2018-08-28-93.iso
|
./setup_configuration.sh -c simplex -i stx-2018-08-28-93.iso
|
||||||
|
|
||||||
And the setup will begin. The script create one or more VMs and start the boot
|
And the setup will begin. The script create one or more VMs and start the boot
|
||||||
of the first controller, named oddly enough ``controller-0``. If you have Xwindows
|
of the first controller, named oddly enough ``controller-0``. If you have Xwindows
|
||||||
|
@ -69,4 +71,4 @@ Continue the usual StarlingX installation from this point forward.
|
||||||
|
|
||||||
Tear down the VMs giving the configuration name with the ``-c`` option::
|
Tear down the VMs giving the configuration name with the ``-c`` option::
|
||||||
|
|
||||||
>-------./destroy_configuration.sh -c allinone
|
>-------./destroy_configuration.sh -c simplex
|
||||||
|
|
|
@ -22,17 +22,28 @@ if [[ -z ${CONFIGURATION} ]]; then
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CONFIGURATION=${CONFIGURATION:-allinone}
|
configuration_check ${CONFIGURATION}
|
||||||
|
|
||||||
|
CONFIGURATION=${CONFIGURATION:-simplex}
|
||||||
CONTROLLER=${CONTROLLER:-controller}
|
CONTROLLER=${CONTROLLER:-controller}
|
||||||
DOMAIN_DIRECTORY=vms
|
DOMAIN_DIRECTORY=vms
|
||||||
|
|
||||||
destroy_controller ${CONFIGURATION} ${CONTROLLER}
|
destroy_controller ${CONFIGURATION} ${CONTROLLER}
|
||||||
|
|
||||||
if ([ "$CONFIGURATION" == "standardcontroller" ]); then
|
if ([ "$CONFIGURATION" == "controllerstorage" ] || [ "$CONFIGURATION" == "dedicatedstorage" ]); then
|
||||||
COMPUTE=${COMPUTE:-compute}
|
WORKER=${WORKER:-worker}
|
||||||
COMPUTE_NODES_NUMBER=${COMPUTE_NODES_NUMBER:-1}
|
WORKER_NODES_NUMBER=${WORKER_NODES_NUMBER:-1}
|
||||||
for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do
|
for ((i=0; i<=$WORKER_NODES_NUMBER; i++)); do
|
||||||
COMPUTE_NODE=${COMPUTE}-${i}
|
WORKER_NODE=${CONFIGURATION}-${WORKER}-${i}
|
||||||
destroy_compute $COMPUTE_NODE
|
destroy_node "worker" $WORKER_NODE
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ([ "$CONFIGURATION" == "dedicatedstorage" ]); then
|
||||||
|
STORAGE=${STORAGE:-storage}
|
||||||
|
STORAGE_NODES_NUMBER=${STORAGE_NODES_NUMBER:-1}
|
||||||
|
for ((i=0; i<=$STORAGE_NODES_NUMBER; i++)); do
|
||||||
|
STORAGE_NODE=${CONFIGURATION}-${STORAGE}-${i}
|
||||||
|
destroy_node "storage" ${STORAGE_NODE}
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -4,7 +4,7 @@ usage() {
|
||||||
echo "$0 [-h] [-c <configuration>] [-i <iso image>]"
|
echo "$0 [-h] [-c <configuration>] [-i <iso image>]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " -c: Configuration: allinone, standardcontroller"
|
echo " -c: Configuration: simplex, duplex, controllerstorage, dedicatedstorage"
|
||||||
echo " -i: StarlingX ISO image"
|
echo " -i: StarlingX ISO image"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ usage_destroy() {
|
||||||
echo "$0 [-h] [-c <configuration>]"
|
echo "$0 [-h] [-c <configuration>]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " -c: Configuration: allinone, standardcontroller"
|
echo " -c: Configuration: simplex, duplex, controllerstorage, dedicatedstorage"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,15 @@ iso_image_check() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configuration_check() {
|
||||||
|
local CONFIGURATION=$1
|
||||||
|
if [ $CONFIGURATION != "simplex" ] && [ $CONFIGURATION != "duplex" ] && [ $CONFIGURATION != "controllerstorage" ] && [ $CONFIGURATION != "dedicatedstorage" ]; then
|
||||||
|
echo "Please check your configuration name, available configurations:"
|
||||||
|
echo "simplex, duplex, controllerstorage, dedicatedstorage"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# delete a node's disk file in a safe way
|
# delete a node's disk file in a safe way
|
||||||
delete_disk() {
|
delete_disk() {
|
||||||
local fpath="$1"
|
local fpath="$1"
|
||||||
|
@ -68,15 +77,15 @@ create_controller() {
|
||||||
local BRIDGE_INTERFACE=$3
|
local BRIDGE_INTERFACE=$3
|
||||||
local ISOIMAGE=$4
|
local ISOIMAGE=$4
|
||||||
local DOMAIN_FILE
|
local DOMAIN_FILE
|
||||||
if ([ "$CONFIGURATION" == "allinone" ]); then
|
if ([ "$CONFIGURATION" == "simplex" ]); then
|
||||||
CONTROLLER_NODE_NUMBER=0
|
CONTROLLER_NODE_NUMBER=0
|
||||||
else
|
else
|
||||||
CONTROLLER_NODE_NUMBER=1
|
CONTROLLER_NODE_NUMBER=1
|
||||||
fi
|
fi
|
||||||
for ((i=0; i<=$CONTROLLER_NODE_NUMBER; i++)); do
|
for ((i=0; i<=$CONTROLLER_NODE_NUMBER; i++)); do
|
||||||
CONTROLLER_NODE=${CONTROLLER}-${i}
|
CONTROLLER_NODE=${CONFIGURATION}-${CONTROLLER}-${i}
|
||||||
DOMAIN_FILE=${DOMAIN_DIRECTORY}/${CONTROLLER_NODE}.xml
|
DOMAIN_FILE=${DOMAIN_DIRECTORY}/${CONTROLLER_NODE}.xml
|
||||||
if ([ "$CONFIGURATION" == "allinone" ]); then
|
if ([ "$CONFIGURATION" == "simplex" ] || [ "$CONFIGURATION" == "duplex" ]); then
|
||||||
DISK_0_SIZE=600
|
DISK_0_SIZE=600
|
||||||
cp controller_allinone.xml ${DOMAIN_FILE}
|
cp controller_allinone.xml ${DOMAIN_FILE}
|
||||||
else
|
else
|
||||||
|
@ -94,7 +103,7 @@ create_controller() {
|
||||||
" ${DOMAIN_FILE}
|
" ${DOMAIN_FILE}
|
||||||
sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${CONTROLLER_NODE}-0.img ${DISK_0_SIZE}G
|
sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${CONTROLLER_NODE}-0.img ${DISK_0_SIZE}G
|
||||||
sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${CONTROLLER_NODE}-1.img 200G
|
sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${CONTROLLER_NODE}-1.img 200G
|
||||||
if ([ "$CONFIGURATION" == "allinone" ]); then
|
if ([ "$CONFIGURATION" == "simplex" ] || [ "$CONFIGURATION" == "duplex" ]); then
|
||||||
sed -i -e "
|
sed -i -e "
|
||||||
s,DISK2,/var/lib/libvirt/images/${CONTROLLER_NODE}-2.img,
|
s,DISK2,/var/lib/libvirt/images/${CONTROLLER_NODE}-2.img,
|
||||||
" ${DOMAIN_FILE}
|
" ${DOMAIN_FILE}
|
||||||
|
@ -116,13 +125,13 @@ create_controller() {
|
||||||
destroy_controller() {
|
destroy_controller() {
|
||||||
local CONFIGURATION=$1
|
local CONFIGURATION=$1
|
||||||
local CONTROLLER=$2
|
local CONTROLLER=$2
|
||||||
if ([ "$CONFIGURATION" == "allinone" ]); then
|
if ([ "$CONFIGURATION" == "simplex" ]); then
|
||||||
CONTROLLER_NODE_NUMBER=0
|
CONTROLLER_NODE_NUMBER=0
|
||||||
else
|
else
|
||||||
CONTROLLER_NODE_NUMBER=1
|
CONTROLLER_NODE_NUMBER=1
|
||||||
fi
|
fi
|
||||||
for ((i=0; i<=$CONTROLLER_NODE_NUMBER; i++)); do
|
for ((i=0; i<=$CONTROLLER_NODE_NUMBER; i++)); do
|
||||||
CONTROLLER_NODE=${CONTROLLER}-${i}
|
CONTROLLER_NODE=${CONFIGURATION}-${CONTROLLER}-${i}
|
||||||
DOMAIN_FILE=$DOMAIN_DIRECTORY/$CONTROLLER_NODE.xml
|
DOMAIN_FILE=$DOMAIN_DIRECTORY/$CONTROLLER_NODE.xml
|
||||||
if virsh list --all --name | grep ${CONTROLLER_NODE}; then
|
if virsh list --all --name | grep ${CONTROLLER_NODE}; then
|
||||||
STATUS=$(virsh list --all | grep ${CONTROLLER_NODE} | awk '{ print $3}')
|
STATUS=$(virsh list --all | grep ${CONTROLLER_NODE} | awk '{ print $3}')
|
||||||
|
@ -133,7 +142,7 @@ destroy_controller() {
|
||||||
sudo virsh undefine ${CONTROLLER_NODE}
|
sudo virsh undefine ${CONTROLLER_NODE}
|
||||||
delete_disk /var/lib/libvirt/images/${CONTROLLER_NODE}-0.img
|
delete_disk /var/lib/libvirt/images/${CONTROLLER_NODE}-0.img
|
||||||
delete_disk /var/lib/libvirt/images/${CONTROLLER_NODE}-1.img
|
delete_disk /var/lib/libvirt/images/${CONTROLLER_NODE}-1.img
|
||||||
if ([ "$CONFIGURATION" == "allinone" ]); then
|
if ([ "$CONFIGURATION" == "simplex" ] || [ "$CONFIGURATION" == "duplex" ]); then
|
||||||
delete_disk /var/lib/libvirt/images/${CONTROLLER_NODE}-2.img
|
delete_disk /var/lib/libvirt/images/${CONTROLLER_NODE}-2.img
|
||||||
fi
|
fi
|
||||||
[ -e ${DOMAIN_FILE} ] && delete_xml ${DOMAIN_FILE}
|
[ -e ${DOMAIN_FILE} ] && delete_xml ${DOMAIN_FILE}
|
||||||
|
@ -141,17 +150,19 @@ destroy_controller() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create a Compute node
|
# Create a Node
|
||||||
create_compute() {
|
create_node() {
|
||||||
local COMPUTE_NODE=$1
|
local IDENTITY=$1
|
||||||
local DOMAIN_FILE=${DOMAIN_DIRECTORY}/${COMPUTE_NODE}.xml
|
local NODE=$2
|
||||||
sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${COMPUTE_NODE}-0.img 200G
|
local BRIDGE_INTERFACE=$3
|
||||||
sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${COMPUTE_NODE}-1.img 200G
|
local DOMAIN_FILE=${DOMAIN_DIRECTORY}/${NODE}.xml
|
||||||
cp compute.xml ${DOMAIN_FILE}
|
sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${NODE}-0.img 200G
|
||||||
|
sudo qemu-img create -f qcow2 /var/lib/libvirt/images/${NODE}-1.img 200G
|
||||||
|
cp ${IDENTITY}.xml ${DOMAIN_FILE}
|
||||||
sed -i -e "
|
sed -i -e "
|
||||||
s,NAME,${COMPUTE_NODE},;
|
s,NAME,${NODE},;
|
||||||
s,DISK0,/var/lib/libvirt/images/${COMPUTE_NODE}-0.img,;
|
s,DISK0,/var/lib/libvirt/images/${NODE}-0.img,;
|
||||||
s,DISK1,/var/lib/libvirt/images/${COMPUTE_NODE}-1.img,
|
s,DISK1,/var/lib/libvirt/images/${NODE}-1.img,
|
||||||
s,%BR1%,${BRIDGE_INTERFACE}1,
|
s,%BR1%,${BRIDGE_INTERFACE}1,
|
||||||
s,%BR2%,${BRIDGE_INTERFACE}2,
|
s,%BR2%,${BRIDGE_INTERFACE}2,
|
||||||
s,%BR3%,${BRIDGE_INTERFACE}3,
|
s,%BR3%,${BRIDGE_INTERFACE}3,
|
||||||
|
@ -160,19 +171,20 @@ create_compute() {
|
||||||
sudo virsh define ${DOMAIN_FILE}
|
sudo virsh define ${DOMAIN_FILE}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Delete a Compute node
|
# Delete a Node
|
||||||
destroy_compute() {
|
destroy_node() {
|
||||||
local COMPUTE_NODE=$1
|
local IDENTITY=$1
|
||||||
local DOMAIN_FILE=$DOMAIN_DIRECTORY/$COMPUTE_NODE.xml
|
local NODE=$2
|
||||||
if virsh list --all --name | grep ${COMPUTE_NODE}; then
|
local DOMAIN_FILE=$DOMAIN_DIRECTORY/$NODE.xml
|
||||||
STATUS=$(virsh list --all | grep ${COMPUTE_NODE} | awk '{ print $3}')
|
if virsh list --all --name | grep ${NODE}; then
|
||||||
|
STATUS=$(virsh list --all | grep ${NODE} | awk '{ print $3}')
|
||||||
if ([ "$STATUS" == "running" ])
|
if ([ "$STATUS" == "running" ])
|
||||||
then
|
then
|
||||||
sudo virsh destroy ${COMPUTE_NODE}
|
sudo virsh destroy ${NODE}
|
||||||
fi
|
fi
|
||||||
sudo virsh undefine ${COMPUTE_NODE}
|
sudo virsh undefine ${NODE}
|
||||||
delete_disk /var/lib/libvirt/images/${COMPUTE_NODE}-0.img
|
delete_disk /var/lib/libvirt/images/${NODE}-0.img
|
||||||
delete_disk /var/lib/libvirt/images/${COMPUTE_NODE}-1.img
|
delete_disk /var/lib/libvirt/images/${NODE}-1.img
|
||||||
[ -e ${DOMAIN_FILE} ] && delete_xml ${DOMAIN_FILE}
|
[ -e ${DOMAIN_FILE} ] && delete_xml ${DOMAIN_FILE}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,12 +25,15 @@ if [[ -z ${CONFIGURATION} ]] || [[ -z "${ISOIMAGE}" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
iso_image_check ${ISOIMAGE}
|
iso_image_check ${ISOIMAGE}
|
||||||
|
configuration_check ${CONFIGURATION}
|
||||||
|
|
||||||
CONFIGURATION=${CONFIGURATION:-allinone}
|
CONFIGURATION=${CONFIGURATION:-simplex}
|
||||||
BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
|
BRIDGE_INTERFACE=${BRIDGE_INTERFACE:-stxbr}
|
||||||
CONTROLLER=${CONTROLLER:-controller}
|
CONTROLLER=${CONTROLLER:-controller}
|
||||||
COMPUTE=${COMPUTE:-compute}
|
WORKER=${WORKER:-worker}
|
||||||
COMPUTE_NODES_NUMBER=${COMPUTE_NODES_NUMBER:-1}
|
WORKER_NODES_NUMBER=${WORKER_NODES_NUMBER:-1}
|
||||||
|
STORAGE=${STORAGE:-storage}
|
||||||
|
STORAGE_NODES_NUMBER=${STORAGE_NODES_NUMBER:-1}
|
||||||
DOMAIN_DIRECTORY=vms
|
DOMAIN_DIRECTORY=vms
|
||||||
|
|
||||||
bash ${SCRIPT_DIR}/destroy_configuration.sh -c $CONFIGURATION
|
bash ${SCRIPT_DIR}/destroy_configuration.sh -c $CONFIGURATION
|
||||||
|
@ -39,10 +42,17 @@ bash ${SCRIPT_DIR}/destroy_configuration.sh -c $CONFIGURATION
|
||||||
|
|
||||||
create_controller $CONFIGURATION $CONTROLLER $BRIDGE_INTERFACE $ISOIMAGE
|
create_controller $CONFIGURATION $CONTROLLER $BRIDGE_INTERFACE $ISOIMAGE
|
||||||
|
|
||||||
if ([ "$CONFIGURATION" == "standardcontroller" ]); then
|
if ([ "$CONFIGURATION" == "controllerstorage" ] || [ "$CONFIGURATION" == "dedicatedstorage" ]); then
|
||||||
for ((i=0; i<=$COMPUTE_NODES_NUMBER; i++)); do
|
for ((i=0; i<=$WORKER_NODES_NUMBER; i++)); do
|
||||||
COMPUTE_NODE=${COMPUTE}-${i}
|
WORKER_NODE=${CONFIGURATION}-${WORKER}-${i}
|
||||||
create_compute ${COMPUTE_NODE}
|
create_node "worker" ${WORKER_NODE} ${BRIDGE_INTERFACE}
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ([ "$CONFIGURATION" == "dedicatedstorage" ]); then
|
||||||
|
for ((i=0; i<=$STORAGE_NODES_NUMBER; i++)); do
|
||||||
|
STORAGE_NODE=${CONFIGURATION}-${STORAGE}-${i}
|
||||||
|
create_node "storage" ${STORAGE_NODE} ${BRIDGE_INTERFACE}
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,95 @@
|
||||||
|
<domain type='kvm' id='187'>
|
||||||
|
<name>NAME</name>
|
||||||
|
<memory unit='KiB'>16777216</memory>
|
||||||
|
<currentMemory unit='KiB'>16777216</currentMemory>
|
||||||
|
<vcpu placement='static'>4</vcpu>
|
||||||
|
<resource>
|
||||||
|
<partition>/machine</partition>
|
||||||
|
</resource>
|
||||||
|
<os>
|
||||||
|
<type arch='x86_64' machine='pc-q35-xenial'>hvm</type>
|
||||||
|
</os>
|
||||||
|
<features>
|
||||||
|
<acpi/>
|
||||||
|
<apic/>
|
||||||
|
<pae/>
|
||||||
|
</features>
|
||||||
|
<cpu match='exact'>
|
||||||
|
<model fallback='forbid'>Nehalem</model>
|
||||||
|
<topology sockets='1' cores='4' threads='1'/>
|
||||||
|
<feature policy='require' name='vmx'/>
|
||||||
|
<feature policy='optional' name='svm'/>
|
||||||
|
</cpu>
|
||||||
|
<clock offset='utc'/>
|
||||||
|
<on_poweroff>destroy</on_poweroff>
|
||||||
|
<on_reboot>restart</on_reboot>
|
||||||
|
<on_crash>destroy</on_crash>
|
||||||
|
<devices>
|
||||||
|
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||||
|
<disk type='file' device='disk'>
|
||||||
|
<driver name='qemu' type='qcow2'/>
|
||||||
|
<source file='DISK0'/>
|
||||||
|
<backingStore/>
|
||||||
|
<target dev='sda' bus='sata'/>
|
||||||
|
<boot order='1'/>
|
||||||
|
</disk>
|
||||||
|
<disk type='file' device='disk'>
|
||||||
|
<driver name='qemu' type='qcow2'/>
|
||||||
|
<source file='DISK1'/>
|
||||||
|
<backingStore/>
|
||||||
|
<target dev='sdb' bus='sata'/>
|
||||||
|
</disk>
|
||||||
|
<interface type='bridge'>
|
||||||
|
<source bridge='%BR1%'/>
|
||||||
|
<target dev='vnet8'/>
|
||||||
|
<model type='e1000'/>
|
||||||
|
<alias name='net0'/>
|
||||||
|
</interface>
|
||||||
|
<interface type='bridge'>
|
||||||
|
<source bridge='%BR2%'/>
|
||||||
|
<target dev='vnet9'/>
|
||||||
|
<model type='e1000'/>
|
||||||
|
<boot order='2'/>
|
||||||
|
<alias name='net1'/>
|
||||||
|
</interface>
|
||||||
|
<interface type='bridge'>
|
||||||
|
<source bridge='%BR3%'/>
|
||||||
|
<target dev='vnet10'/>
|
||||||
|
<model type='virtio'/>
|
||||||
|
<alias name='net2'/>
|
||||||
|
</interface>
|
||||||
|
<interface type='bridge'>
|
||||||
|
<source bridge='%BR4%'/>
|
||||||
|
<target dev='vnet11'/>
|
||||||
|
<model type='virtio'/>
|
||||||
|
<alias name='net3'/>
|
||||||
|
</interface>
|
||||||
|
<serial type='pty'>
|
||||||
|
<source path='/dev/pts/12'/>
|
||||||
|
<target port='0'/>
|
||||||
|
<alias name='serial0'/>
|
||||||
|
</serial>
|
||||||
|
<console type='pty' tty='/dev/pts/12'>
|
||||||
|
<source path='/dev/pts/12'/>
|
||||||
|
<target type='serial' port='0'/>
|
||||||
|
<alias name='serial0'/>
|
||||||
|
</console>
|
||||||
|
<input type='mouse' bus='ps2'/>
|
||||||
|
<input type='keyboard' bus='ps2'/>
|
||||||
|
<graphics type='vnc' port='5903' autoport='yes' listen='127.0.0.1'
|
||||||
|
keymap='en-us'>
|
||||||
|
<listen type='address' address='127.0.0.1'/>
|
||||||
|
</graphics>
|
||||||
|
<video>
|
||||||
|
<model type='cirrus' vram='16384' heads='1'/>
|
||||||
|
<alias name='video0'/>
|
||||||
|
</video>
|
||||||
|
<memballoon model='virtio'>
|
||||||
|
<alias name='balloon0'/>
|
||||||
|
</memballoon>
|
||||||
|
</devices>
|
||||||
|
<seclabel type='dynamic' model='apparmor' relabel='yes'>
|
||||||
|
<label>libvirt-608ab5c8-8d11-4bdd-885f-f8b5fee12ff0</label>
|
||||||
|
<imagelabel>libvirt-608ab5c8-8d11-4bdd-885f-f8b5fee12ff0</imagelabel>
|
||||||
|
</seclabel>
|
||||||
|
</domain>
|
Loading…
Reference in New Issue