Skip to content

Commit 2664b50

Browse files
resmomattclay
authored andcommitted
use new LTS CloudStack v4.11.1 (#3)
* use new LTS CloudStack v4.11.1 * add workarounds for open issues
1 parent 3656061 commit 2664b50

File tree

6 files changed

+39
-21
lines changed

6 files changed

+39
-21
lines changed

Dockerfile

+8-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ FROM ubuntu:16.04
22

33
MAINTAINER "René Moser" <[email protected]>
44

5+
ARG src_url=https://github.com/apache/cloudstack/archive/4.11.1.0.tar.gz
6+
57
RUN echo 'mysql-server mysql-server/root_password password root' | debconf-set-selections; \
68
echo 'mysql-server mysql-server/root_password_again password root' | debconf-set-selections;
79

8-
RUN apt-get -y update && apt-get install -y \
10+
RUN apt-get -y update && apt-get dist-upgrade -y && apt-get install -y \
911
genisoimage \
1012
libffi-dev \
1113
libssl-dev \
@@ -38,7 +40,7 @@ RUN mkdir -p /var/run/mysqld; \
3840

3941
RUN (/usr/bin/mysqld_safe &); sleep 5; mysqladmin -u root -proot password ''
4042

41-
RUN wget https://github.com/apache/cloudstack/archive/4.9.2.0.tar.gz -O /opt/cloudstack.tar.gz; \
43+
RUN wget $src_url -O /opt/cloudstack.tar.gz; \
4244
mkdir -p /opt/cloudstack; \
4345
tar xvzf /opt/cloudstack.tar.gz -C /opt/cloudstack --strip-components=1
4446

@@ -57,10 +59,13 @@ RUN (/usr/bin/mysqld_safe &); \
5759

5860
COPY zones.cfg /opt/zones.cfg
5961
COPY nginx_default.conf /etc/nginx/sites-available/default
60-
RUN pip install cs==1.1.1
62+
RUN pip install cs==2.3.1
6163
COPY run.sh /opt/run.sh
64+
COPY deploy.sh /opt/deploy.sh
6265
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
6366

67+
RUN /opt/deploy.sh
68+
6469
EXPOSE 8888 8080 8096
6570

6671
CMD ["/usr/bin/supervisord"]

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
build:
2-
docker build -t cloudstack-sim .
2+
docker build --no-cache -t cloudstack-sim .
33

44
clean:
5-
docker rm -f cloudstack
5+
docker rm -f cloudstack-sim
66

77
run:
8-
docker run --name cloudstack -d -p 8080:8080 -p 8888:8888 cloudstack-sim
8+
docker run --name cloudstack-sim -d -p 8080:8080 -p 8888:8888 cloudstack-sim
99

1010
shell:
11-
docker exec -it cloudstack /bin/bash
11+
docker exec -it cloudstack-sim /bin/bash
1212

1313
logs:
14-
docker logs -f cloudstack
14+
docker logs -f cloudstack-sim

deploy.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash +x
2+
3+
/usr/bin/mysqld_safe &
4+
cd /opt/cloudstack && mvn -pl client jetty:run -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120 &
5+
6+
until nc -z localhost 8096; do
7+
echo "waiting for port 8096..."
8+
sleep 3
9+
done
10+
11+
sleep 3
12+
python /opt/cloudstack/tools/marvin/marvin/deployDataCenter.py -i /opt/zones.cfg

run.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ done
77
sleep 3
88
if [ ! -e /var/www/html/admin.json ]
99
then
10-
python /opt/cloudstack/tools/marvin/marvin/deployDataCenter.py -i /opt/zones.cfg
1110
export CLOUDSTACK_ENDPOINT=http://127.0.0.1:8096
1211
export CLOUDSTACK_KEY=""
1312
export CLOUDSTACK_SECRET=""
14-
cs listUsers account=admin | jq .user[0] > /var/www/html/admin.json
13+
14+
# Workaround for Nuage VPC Offering
15+
vpc_offering_id="$(cs listVPCOfferings listall=true name=Nuage | jq .vpcoffering[0].id)"
16+
cs updateVPCOffering id=$vpc_offering_id state=Disabled
17+
18+
admin_id="$(cs listUsers account=admin | jq .user[0].id)"
19+
cs getUserKeys id=$admin_id | jq .userkeys > /var/www/html/admin.json
1520
fi

supervisord.conf

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ autorestart=true
88
user=root
99

1010
[program:cloudstack]
11-
command=/bin/bash -c "mvn -pl client jetty:run-forked -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120"
11+
command=/bin/bash -c "mvn -pl client jetty:run -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120"
1212
directory=/opt/cloudstack
1313
stdout_logfile=/dev/stdout
1414
stdout_logfile_maxbytes=0
@@ -20,9 +20,9 @@ autostart=true
2020
autorestart=false
2121
user=root
2222

23-
[program:deploy-zones]
24-
command = /opt/run.sh
25-
startsecs = 0
26-
autorestart = false
27-
startretries = 1
23+
[program:run]
24+
command=/opt/run.sh
25+
startsecs=0
26+
autorestart=false
27+
startretries=1
2828
user=root

zones.cfg

+1-5
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,7 @@
288288
},
289289
{
290290
"name": "ping.timeout",
291-
"value": "1.5"
292-
},
293-
{
294-
"name": "outofbandmanagement.sync.interval",
295-
"value": "1000"
291+
"value": "2"
296292
}
297293
],
298294
"mgtSvr": [

0 commit comments

Comments
 (0)