Skip to content

Commit

Permalink
Deploy 2 VMs with different vm_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
bingosummer committed Oct 26, 2018
1 parent 2b4832a commit 8c4c943
Showing 1 changed file with 58 additions and 2 deletions.
60 changes: 58 additions & 2 deletions scenarios/vm-resources/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ update:
serial: false
update_watch_time: 5000-1200000
instance_groups:
- name: nginx
- name: nginx-1
instances: 1
azs: [ z1 ]
vm_resources:
Expand Down Expand Up @@ -53,7 +53,63 @@ instance_groups:
mkdir -p $NGINX_DIR
cd $NGINX_DIR
cat > index.shtml <<EOF
<html><head><title>BOSH on IPv6</title>
<html><head><title>nginx-1</title>
</head><body>
<h2>Welcome to BOSH's nginx Release</h2>
<h2>
My hostname/IP: <b><!--# echo var="HTTP_HOST" --></b><br />
Your IP: <b><!--# echo var="REMOTE_ADDR" --></b>
</h2>
</body></html>
EOF
fi
- name: nginx-2
instances: 1
azs: [ z1 ]
vm_resources:
cpu: 2
ram: 2048
ephemeral_disk_size: 204800
persistent_disk_type: default
stemcell: default
networks:
- name: ((scenario))
jobs:
- name: nginx
release: nginx
properties:
nginx_conf: |
user nobody vcap; # group vcap can read most directories
worker_processes 1;
error_log /var/vcap/sys/log/nginx/error.log info;
events {
worker_connections 1024;
}
http {
include /var/vcap/packages/nginx/conf/mime.types;
default_type application/octet-stream;
sendfile on;
ssi on;
keepalive_timeout 65;
server_names_hash_bucket_size 64;
server {
server_name _; # invalid value which will never trigger on a real hostname.
listen *:80;
# FIXME: replace all occurrences of 'example.com' with your server's FQDN
access_log /var/vcap/sys/log/nginx/example.com-access.log;
error_log /var/vcap/sys/log/nginx/example.com-error.log;
root /var/vcap/data/nginx/document_root;
index index.shtml;
}
}
pre_start: |
#!/bin/bash -ex
NGINX_DIR=/var/vcap/data/nginx/document_root
if [ ! -d $NGINX_DIR ]; then
mkdir -p $NGINX_DIR
cd $NGINX_DIR
cat > index.shtml <<EOF
<html><head><title>nginx-2</title>
</head><body>
<h2>Welcome to BOSH's nginx Release</h2>
<h2>
Expand Down

0 comments on commit 8c4c943

Please sign in to comment.