Symptoms
A task to remove old application templates from OA fails:
Queue name hn_template_operation_xxx
Task name Uninstall Virtuozzo template #12 (hn_id <NODE>)
Task description Uninstall Virtuozzo template #aaa from Hardware Node #bbb
Queue status Failed
Method name taskUninstallTemplateFromHN on SCREF:VPSTasks:0
....
Last execution output 3502 : Can not remove packages: some Containers use package(s) .pa50-webalizer (OS .centos-5-x86_64)
Cause
The application template in question (.pa50-webalizer in the example above) is used by at least one VPS on the hardware node. As a result, it cannot be removed.
If POA shows the usage of the application template is 0 in Service Director > Virtozoo Manager > VPS Hardware Nodes > <NODE>
> Templates > Application Templates, check usage on the hardware node itself. This can be done in the following way:
# grep pa50-webalizer /etc/vz/conf/*.conf
/etc/vz/conf/1039.conf:TEMPLATES=" .pa50-frontpage .ride_ImageMagick .pa52-php5-cgi .pa50-mysql-client .pa50-pgsql-client .pa50-webalizer .pa50-apache-httpd .pa52-proftpd .pa50-proftpd .pa54-pleskd .pa54-frontpage"
Resolution
Update the template to newer version, then remove the old one. Note the OS in the example task.
Create a repofile to be able to list packages
For POA 5.4:
# cat poa54.repo [poa54] name=POA54 baseurl=http://download.pa.parallels.com/poa/5.4/RPMS/centos/5/x86_64 enabled=0 gpgcheck=0
For POA 5.5:
# cat poa55.repo [poa55] name=POA55 baseurl=http://download.pa.parallels.com/poa/5.5/RPMS/centos/5/x86_64 enabled=0 gpgcheck=0
Compare the packages in the old template with packages in the new template
# yum list webalizer --disablerepo=\* --enablerepo=poa54 ... webalizer.x86_64 2.21_02-2.parallels # vzctl exec 1043 rpm -qi webalizer ... Group : Applications/Internet Source RPM: webalizer-2.21_02-2.parallels.src.rpm
If the packages are the same, it is safe to replace the old template with the new one. Install the new version of the application into VPS via POA through Virtuozzo Manager, and ensure that the task completes successfully
Remove the reference to old application template from the VPS using
/etc/vz/conf/<VPS_ID>.conf
This is important since the older version and the new version of the package may use the same libs.- Restart the original task to remove the application template in POA task manager to ensure the POA DB shows a consistent state.