Skip to content

Commit

Permalink
Updated to Match MLavi
Browse files Browse the repository at this point in the history
  • Loading branch information
jncox committed Feb 15, 2019
1 parent d2f0d43 commit e05fe5c
Show file tree
Hide file tree
Showing 26 changed files with 1,514 additions and 730 deletions.
74 changes: 37 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
This script supports staging HPoC clusters for [Nutanix Workshops](http://www.nutanixworkshops.com).
This script supports staging HPoC clusters for [Nutanix Workshops](https://nutanix.handsonworkshops.com/).
It automates the majority of the [Workshop Setup Guide](http://www.nutanixworkshops.com/en/latest/setup/).
After HPoC Foundation, you can have push-button Calm in about half an hour!

# Table of Contents #

1. [Available Workshops](#available-workshops)
2. [HPoC Cluster Reservation](#hpoc-cluster-reservation)
3. [Staging Your HPoC](#staging-your-hpoc)
1. [Interactive Usage](#interactive-usage)
2. [Non-interactive Usage](#non-interactive-usage)
4. [Validate Staged Clusters](#validate-staged-clusters)
5. [Authentication](#authentication)
---

# Table of Contents #
<!-- MDTOC maxdepth:6 firsth1:0 numbering:0 flatten:0 bullets:1 updateOnSave:1 -->

- [Available Workshops](#available-workshops)
- [HPoC Cluster Reservation](#hpoc-cluster-reservation)
- [Staging Your HPoC](#staging-your-hpoc)
- [Interactive Usage](#interactive-usage)
- [Non-interactive Usage](#non-interactive-usage)
- [Validate Staged Clusters](#validate-staged-clusters)
- [Authentication](#authentication)

<!-- /MDTOC -->
---
## Available Workshops ##

1. Calm Introduction Workshop (AOS/AHV 5.5+)
2. Citrix Desktop on AHV Workshop (AOS/AHV 5.6)

See the WORKSHOPS list at the top of [stage_workshop.sh](blob/master/stage_workshop.sh#L8).

## HPoC Cluster Reservation ##

Make your new reservation on https://rx.corp.nutanix.com/ with:

- __Region:__ NX-US-West or US-East regions only
- __AOS + Hypevisor:__ proper versions for your workshop, specified above
- __AOS + Hypervisor:__ proper versions for your workshop, specified above
- Recommended: AOS and AHV 5.8
- Older or newer versions may not function as expected
- __OS Images:__ *you do not* need to specify images (CentOS, Windows2012, etc.) for your reservation
- __VM Images:__ *you do not* need to specify images (CentOS, Windows2012, etc.) for your reservation

## Staging Your HPoC ##

Expand Down Expand Up @@ -60,15 +66,13 @@ Finally, execute the script to stage the HPOC clusters defined in your text file

### Interactive Usage ###

````./stage_workshop.sh````
`./stage_workshop.sh`

Running the script interactively
will prompt you to input the name of your text file containing your cluster IP and password details.
You will then be prompted to choose a Workshop to stage.
Running the script interactively will prompt you to input the name of your text file containing your cluster IP and password details. You will then be prompted to choose a Workshop to stage.

### Non-interactive Usage ###

````./stage_workshop.sh -f [example_pocs.txt] -w [workshop number]````
`./stage_workshop.sh -f [example_pocs.txt] -w [workshop number]`

Each staging option will deploy:

Expand All @@ -77,31 +81,27 @@ Each staging option will deploy:
- Prism Central
- configuring AHV networks for your Primary and Secondary VLANs.

If you encounter issues reach out to @matt on Slack.
Ask questions not covered here to the Global Sales Technical Enablement team via Slack, review the pinned items in each channel first:
- __#technology-bootcamps:__ for customer and prospect bootcamps
- __#hands-on-workshops:__ for Nutanix Partner and SE workshops

## Validate Staged Clusters ##
### Validate Staged Clusters ###

After staging (~30m), you can re-run the stage_workshop script and select "Validate Staged Clusters" to perform a quick check to ensure all images were uploaded and that Prism Central was provisioned as expected.

Example:

````
./stage_workshop.sh
Cluster Input File: example_pocs.txt
1) Calm Introduction Workshop (AOS/AHV 5.6)
2) Citrix Desktop on AHV Workshop (AOS/AHV 5.6)
3) Change Cluster Input File
4) Validate Staged Clusters
5) Quit
Select an option: 4
10.21.44.37 - Prism Central staging FAILED
10.21.44.37 - Review logs at 10.21.44.37:/home/nutanix/config.log and 10.21.44.39:/home/nutanix/pcconfig.log
````
./stage_workshop.sh
Cluster Input File: example_pocs.txt
1) Calm Introduction Workshop (AOS/AHV 5.6)
2) Citrix Desktop on AHV Workshop (AOS/AHV 5.6)
3) Change Cluster Input File
4) Validate Staged Clusters
5) Quit
Select an option: 4
10.21.44.37 - Prism Central staging FAILED
10.21.44.37 - Review logs at 10.21.44.37:/home/nutanix/config.log and 10.21.44.39:/home/nutanix/pcconfig.log

## Authentication ##

OpenLDAP works fine for authentication, but Prism Central has a problem with anything more than simple RBAC with it.
- https://jira.nutanix.com/browse/ENG-126217 openldap authentication difference in PC vs PE
- fixed with PC 5.7.1

In the meantime, one can use Windows Server: Active Directory, but for simpler and faster results, the automation leverages [AutoDC](autodc/README.md).
One can use Windows Server: Active Directory, but for simpler and faster results, the automation leverages [AutoDC](documentation/autodc/README.md).
41 changes: 20 additions & 21 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ if [[ -z ${SOURCE} ]]; then
REPOSITORY=stageworkshop
BRANCH=master
else
# shellcheck disable=2206
URL_SOURCE=(${SOURCE//\// }) # zero index
ORGANIZATION=${URL_SOURCE[2]}
REPOSITORY=${URL_SOURCE[3]}
Expand Down Expand Up @@ -38,7 +39,7 @@ if [[ -f ${BRANCH}.zip ]]; then
sh ${HOME}/${0} clean
fi

echo -e "\nFor details, please see: ${BASE_URL}"
echo -e "\nFor details, please see: ${BASE_URL}/documentation/guidebook.md"

_ERROR=0

Expand All @@ -55,8 +56,8 @@ CLUSTER_NAME+=$(ncli cluster get-params | grep 'Cluster Name' \
| awk -F: '{print $2}' | tr -d '[:space:]')
EMAIL_DOMAIN=nutanix.com

if [[ -z ${MY_PE_PASSWORD} ]]; then
_PRISM_ADMIN=admin
if [[ -z ${PE_PASSWORD} ]]; then
_PRISM_ADMIN='admin'
echo -e "\n Note: Hit [Return] to use the default answer inside brackets.\n"
read -p "Optional: What is this cluster's admin username? [${_PRISM_ADMIN}] " PRISM_ADMIN
if [[ -z ${PRISM_ADMIN} ]]; then
Expand All @@ -72,22 +73,22 @@ if [[ -z ${MY_PE_PASSWORD} ]]; then
echo "Error ${_ERROR}: passwords do not match."
exit ${_ERROR}
else
MY_PE_PASSWORD=${_PW1}
PE_PASSWORD=${_PW1}
unset _PW1 _PW2
fi
fi

if [[ -z ${MY_EMAIL} ]]; then
if [[ -z ${EMAIL} ]]; then
echo -e "\n Note: @${EMAIL_DOMAIN} will be added if domain omitted."
read -p "REQUIRED: Email address for cluster admin? " MY_EMAIL
read -p "REQUIRED: Email address for cluster admin? " EMAIL
fi

_WC_ARG='--lines'
if [[ `uname -s` == "Darwin" ]]; then
if [[ $(uname -s) == 'Darwin' ]]; then
_WC_ARG='-l'
fi
if (( $(echo ${MY_EMAIL} | grep @ | wc ${_WC_ARG}) == 0 )); then
MY_EMAIL+=@${EMAIL_DOMAIN}
if (( $(echo ${EMAIL} | grep @ | wc ${_WC_ARG}) == 0 )); then
EMAIL+=@${EMAIL_DOMAIN}
fi

if [[ -d ../${REPOSITORY}-${BRANCH} ]]; then
Expand All @@ -107,32 +108,30 @@ if [[ -e release.json ]]; then
echo -e "\n${ARCHIVE}::$(basename $0) release: $(grep FullSemVer release.json | awk -F\" '{print $4}')"
fi

MY_PE_HOST=$(ncli cluster get-params \
PE_HOST=$(ncli cluster get-params \
| grep 'External IP' \
| awk -F: '{print $2}' \
| tr -d '[:space:]')

echo -e "\nStarting stage_workshop.sh for ${MY_EMAIL} with ${PRISM_ADMIN}:passwordNotShown@${MY_PE_HOST} ...\n"
echo -e "\nStarting stage_workshop.sh for ${EMAIL} with ${PRISM_ADMIN}:passwordNotShown@${PE_HOST} ...\n"

if [[ ! -z ${WORKSHOP} ]]; then
echo -e "\tAdding workshop: ${WORKSHOP}"
MY_WORKSHOP=" -w ${WORKSHOP}"
fi
MY_EMAIL=${MY_EMAIL} \
MY_PE_HOST=${MY_PE_HOST} \
PRISM_ADMIN=${PRISM_ADMIN} \
MY_PE_PASSWORD=${MY_PE_PASSWORD} \
./stage_workshop.sh -f - ${MY_WORKSHOP} \
&& popd
EMAIL=${EMAIL} \
PE_HOST=${PE_HOST} \
PRISM_ADMIN=${PRISM_ADMIN} \
PE_PASSWORD=${PE_PASSWORD} \
./stage_workshop.sh -f - ${MY_WORKSHOP} # \
# && popd || exit

echo -e "\n DONE: ${0} ran for ${SECONDS} seconds."
cat <<EOM
Optional: Please consider running ${0} clean.
Watch progress with:
tail -f stage_calmhow.log &
tail -f calm.log &
or login to PE to see tasks in flight and eventual PC registration:
https://${MY_PE_HOST}:9440/
https://${PE_HOST}:9440/
EOM

# TODO: determine if I'm on HPOC nw variant for a local URL, etc.
Loading

0 comments on commit e05fe5c

Please sign in to comment.