Update 'maas-setup.sh'
This commit is contained in:
parent
d35d4686e5
commit
12c24c418f
@ -7,6 +7,12 @@
|
|||||||
# Note: this tutorial has not been tested on versions prior to 20.04.
|
# Note: this tutorial has not been tested on versions prior to 20.04.
|
||||||
|
|
||||||
# lxd / maas issue. either upgrade lxd or maas to 3.1
|
# lxd / maas issue. either upgrade lxd or maas to 3.1
|
||||||
|
|
||||||
|
useradd -s /bin/bash -d /home/maas -m maas
|
||||||
|
echo "maas ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/maas
|
||||||
|
|
||||||
|
su - maas
|
||||||
|
|
||||||
sudo snap install --channel=latest/stable lxd
|
sudo snap install --channel=latest/stable lxd
|
||||||
sudo snap refresh --channel=latest/stable lxd
|
sudo snap refresh --channel=latest/stable lxd
|
||||||
sudo snap install jq
|
sudo snap install jq
|
||||||
@ -67,19 +73,19 @@ maas admin tags create name=metal comment='This tag should to machines that will
|
|||||||
### creating VMs for Juju controller and our "bare metal"
|
### creating VMs for Juju controller and our "bare metal"
|
||||||
|
|
||||||
# add a VM for the juju controller with minimal memory
|
# add a VM for the juju controller with minimal memory
|
||||||
maas admin vm-host compose $VM_HOST_ID cores=8 memory=2048 architecture="amd64/generic" \
|
#maas admin vm-host compose $VM_HOST_ID cores=8 memory=2048 architecture="amd64/generic" \
|
||||||
storage="main:16(pool1)" hostname="juju-controller"
|
# storage="main:16(pool1)" hostname="juju-controller"
|
||||||
# get the system-id and tag the machine with "juju-controller"
|
# get the system-id and tag the machine with "juju-controller"
|
||||||
export JUJU_SYSID=$(maas admin machines read | jq '.[]
|
#export JUJU_SYSID=$(maas admin machines read | jq '.[]
|
||||||
| select(."hostname"=="juju-controller")
|
#| select(."hostname"=="juju-controller")
|
||||||
| .["system_id"]' | tr -d '"')
|
#| .["system_id"]' | tr -d '"')
|
||||||
maas admin tag update-nodes "juju-controller" add=$JUJU_SYSID
|
#maas admin tag update-nodes "juju-controller" add=$JUJU_SYSID
|
||||||
|
|
||||||
## Create 3 "bare metal" machines and tag them with "metal"
|
# Create 3 "bare metal" machines and tag them with "metal"
|
||||||
for ID in 1 2 3
|
for ID in {00..49}
|
||||||
do
|
do
|
||||||
maas admin vm-host compose $VM_HOST_ID cores=8 memory=8192 architecture="amd64/generic" \
|
maas admin vm-host compose $VM_HOST_ID cores=1 memory=1024 architecture="amd64/generic" \
|
||||||
storage="main:25(pool1),ceph:100(pool1)" hostname="metal-${ID}"
|
storage="main:25(pool1)" hostname="metal-${ID}"
|
||||||
SYSID=$(maas admin machines read | jq -r --arg MACHINE "metal-${ID}" '.[]
|
SYSID=$(maas admin machines read | jq -r --arg MACHINE "metal-${ID}" '.[]
|
||||||
| select(."hostname"==$MACHINE)
|
| select(."hostname"==$MACHINE)
|
||||||
| .["system_id"]' | tr -d '"')
|
| .["system_id"]' | tr -d '"')
|
||||||
|
Loading…
Reference in New Issue
Block a user