Skip to content

Commit 9c996a2

Browse files
committed
Adjusted the sample code
1 parent d6950a0 commit 9c996a2

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

private-path-to-vpc-vsi/run

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ ibmcloud is security-group $vpc_name-group
245245
# Create the origin server VSI
246246
print_msg "\nCreating the VPC VSI '$vsi_originserver_name', which acts as the origin server ..."
247247
ibmcloud is instance-create $vsi_originserver_name $vpc_name $REGION-1 cx2-2x4 $vpc_name-subnet \
248-
--image ibm-centos-stream-9-amd64-6 \
248+
--image ibm-centos-stream-10-amd64-5 \
249249
--boot-volume "{\"name\": \"boot-vol-attachment-name\", \"volume\": {\"name\": \"$vsi_originserver_name-boot-vol\", \"capacity\": 100, \"profile\": {\"name\": \"general-purpose\"}}, \"delete_volume_on_instance_delete\": true}" \
250250
--resource-group-name $resource_group_name \
251251
--host-failure-policy restart \
@@ -321,15 +321,15 @@ fi
321321

322322
# Create a LB pool
323323
print_msg "\nCreating the VPC Network load balancer pool '$vpc_name-ppnlb-pg-pool' ..."
324-
ibmcloud is load-balancer-pool-create $vpc_name-ppnlb-pg-pool $vpc_name-ppnlb weighted_round_robin tcp 10 2 5 tcp
324+
ibmcloud is load-balancer-pool-create $vpc_name-ppnlb-pg-pool $vpc_name-ppnlb weighted_round_robin tcp 10 2 5 tcp --health-monitor-port 80
325325
if [ $? -ne 0 ]; then
326326
print_error "VPC Network load balancer pool creation failed!"
327327
abortScript
328328
fi
329329

330330
# Create a LB member
331331
print_msg "\nAdd the VSI '$vsi_originserver_name' as a member to the load balancer pool '$vpc_name-ppnlb-pg-pool' ..."
332-
ibmcloud is load-balancer-pool-member-create $vpc_name-ppnlb $vpc_name-ppnlb-pg-pool 5432 $vsi_originserver_name --weight 70
332+
ibmcloud is load-balancer-pool-member-create $vpc_name-ppnlb $vpc_name-ppnlb-pg-pool 5432 $vsi_originserver_name
333333
if [ $? -ne 0 ]; then
334334
print_error "Adding the VSI '$vsi_originserver_name' as a member to the load balancer pool failed!"
335335
abortScript
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
#!/bin/bash
22
touch /tmp/init_started
3+
4+
# ==========================
5+
# nginx installation
6+
# ==========================
7+
dnf -y install nginx
8+
rm -f /usr/share/nginx/html/index.html
9+
echo "Hello world from `hostname`" > /usr/share/nginx/html/index.html
10+
chmod go+r /usr/share/nginx/html/index.html
11+
systemctl enable nginx
12+
systemctl start nginx
13+
systemctl status nginx
14+
touch /tmp/nginx_done
15+
316
# ==========================
417
# PostgreSQL installation
518
# ==========================
6-
yum update -y
719
yum install postgresql-server postgresql-contrib -y
820
postgresql-setup initdb
921
systemctl start postgresql
@@ -22,17 +34,5 @@ psql -c "ALTER USER dbuser PASSWORD 'myPassw0rd!';"
2234
EOF
2335
touch /tmp/postgresql_done
2436

25-
# ==========================
26-
# nginx installation
27-
# ==========================
28-
dnf -y update
29-
dnf -y install nginx
30-
rm -f /usr/share/nginx/html/index.html
31-
echo "Hello world from `hostname`" > /usr/share/nginx/html/index.html
32-
chmod go+r /usr/share/nginx/html/index.html
33-
systemctl enable nginx
34-
systemctl start nginx
35-
systemctl status nginx
36-
touch /tmp/nginx_done
3737

38-
touch /tmp/init_done
38+
touch /tmp/init_done

satellite-connector-to-vpc-vsi/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ echo "Done"
354354
# Create the connector VSI
355355
print_msg "\nCreating the VPC VSI '$vsi_agent_name', which runs the Satellite Connector agent ..."
356356
ibmcloud is instance-create $vsi_agent_name $vpc_name $REGION-1 cx2-2x4 $vpc_name-subnet \
357-
--image ibm-centos-stream-9-amd64-6 \
357+
--image ibm-centos-stream-10-amd64-5 \
358358
--boot-volume '{"name": "boot-vol-attachment-name", "volume": {"name": "my-boot-vol", "capacity": 100, "profile": {"name": "general-purpose"}}, "delete_volume_on_instance_delete": true}' \
359359
--resource-group-name $resource_group_name \
360360
--host-failure-policy restart \

0 commit comments

Comments
 (0)