Managing Containers¶
This section covers various Serviced container topics.
How to Customize and Commit a Container¶
To customize a container and make those changes permanent:
[zenoss@cc]: serviced service shell -i -s mychange zope bash
[root@ZOPE]: su - zenoss
[zenoss@ZOPE]: [make your change change changes in the shell]
[zenoss@ZOPE]: exit
[root@ZOPE]: exit
[zenoss@cc]: serviced snapshot commit mychange
[zenoss@cc]: serviced service restart ...
For example: To add PyYAML to the zope containers:
[zenoss@cc]: serviced service shell -i -s mychange zope bash
[root@ZOPE]: su - zenoss
[zenoss@ZOPE]: easy_install pyyaml
[zenoss@ZOPE]: zendmd
In [1]: import yaml
=> (if no errors, its installed correctly)
[zenoss@ZOPE]: exit
[root@ZOPE]: exit
[zenoss@cc]: serviced snapshot commit mychange
[zenoss@cc]: serviced service restart ...
To customize a remote container you need to provice the full path to the container instance:
serviced service shell -i -s solutions_xxx \
golfballs/Zenoss.resmgr/Zenoss/Collection/localhost/GOLF1/zenpython \
bash
To reconnect to your container after you exit, you need to start it:
docker start solutions_xxx
docker attach solutions_xxx
Installing Linked Zenpack that needs Maven, Java, etc…¶
ZenPacks that need maven offer a slight problem, because you need to install Maven and Java (OpenSDK) to get them installed in link-mode. There is also a minor package dependency problem in zenoss-centos-deps.
They can be installed in the following way in a container:
[zenoss@cc]:serviced service attach zenhub
[root@Zenhub]: yum remove zenoss-centos-deps
[root@Zenhub]: yum install maven
[root@Zenhub]: su - zenoss
[zenoss@Zenhub]: zenpack --link --install /z/ZenPacks.zenoss.XYZ
... exit out of the containers ...
[zenoss@cc]: serviced service restart zenoss.core
Installing Impact into RM with other Link-Mounted ZP’s¶
Overview:
- Ensure you have the Zenoss Impact docker image installed (assume true)
- Ensure ImpactServer and Impact zenpacks are in /z on host; (assume true)
- Create container that has ImpactServer zenpack installed; commit container
- Start ImpactServer
- Create a container that has the Impact zenpack installed; commit container
- Restart services
Start¶
You should first ensure you have the following 2 zp’s in /z:
- ZenPacks.zenoss.ImpactServer-5.x.y.z-py2.7.egg
- ZenPacks.zenoss.Impact-5.x.y.z-py2.7.egg
Create container that has ImpactServer
One issue here is that your /z folder may not be properly mounted. We work around this by manual mounting it in a container:
[you@host]: serviced service shell -i -s impacter --mount /z,/z zope bash [root@65b1f2340c77 /]# su - zenoss Last login: Thu Jul 7 18:27:21 UTC 2016 [zenoss@65b1f2340c77 ~]$ cd /z [zenoss@65b1f2340c77 /z]$ zenpack --install ZenPacks.zenoss.ImpactServer-5.x.y.z-py2.7.egg [zenoss@65b1f2340c77 /z]$ exit [root@65b1f2340c77 /]# exit [you@host]: serviced snapshot commit impacter
Start ImpactServer: serviced service start impact
Create container that has Impact: (Similar as for ImpactServer); commit
Restart core zenoss services
You should see Impact under Infrastructure and Impactstate under Events in UI
Installing ZenETL as a Linked ZP in a ZSD Installation¶
This requires some care because you have to ensure the zen*etl tools get installed into the Zope image. This normally does not happen because in a link install, the normal tools don’t get copied to /opt/zenoss/bin.
First compile the ZP with mvn support externally. Copy the ZP in place.
Edit GNUMakefile and comment out the mvn commands so the container doesn barf.
Execute:
serviced service shell -i -s mychange --mount /z,/z zope su - zenoss [zenoss@612b45db88f8]: cd /z/ZenPacks.zenoss.ZenETL/ZenPacks/zenoss/ZenETL [zenoss@612b45db88f8]: cp daemons/\*.py /opt/zenoss/bin/ [zenoss@612b45db88f8]: cp cp zen\*etl.py /opt/zenoss/ [zenoss@612b45db88f8]: exit
Grab the container number from the shell’s prompt, say: 612b45db88f8
cleanup:
serviced service commit 612b45db88f8 docker rm mychange