Knowledge Base

Browse our knowledge base for free solutions to common problems

Template Not Deleting SolusVM (Template currently in use)

Created On: 14 September 2022
Written by: Ben

Get SolusVM MySQL details:

cat /usr/local/solusvm/includes/solusvm.conf
1i20xjD04BjbwkP:1kKyKHiYgHZOFxf:o0lYkkx2b3Ba03ohTG5wmq5xanTA2Z:localhost:B4oIcEAFInKjrKuqtGiHcKGTZlyjBCMFXJwctDjSAbbCOYORJ8

example: <DATABASENAME>:<USER>:<PASSWORD>:<HOST>:<the key is the last entry>

Login to MySQL:

mysql -u1kKyKHiYgHZOFxf -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 609458
Server version: 5.5.60-MariaDB MariaDB Server
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]>

Show databases:

MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| 1i20xjD04BjbwkP    |
| mysql              |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)

Select the SolusVM database from config:

MariaDB [(none)]> use 1i20xjD04BjbwkP;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed

Show the database tables:

MariaDB [1i20xjD04BjbwkP] show tables
-> ;
+----------------------------+
| Tables_in_1i20xjD04BjbwkP |
+----------------------------+
| adminacl                  |
| administrators            |
| adminlog                  |
| adminnotes                |
| adminwhitelist            |
| api                       |
| apilog                    |
| authenticationlog         |
| backupservers             |
| bandwidthstatistics       |
| buycpanel                 |
| callback                  |
| callbacklog               |
| centralbackup             |
| clientapi                 |
| clientlog                 |
| clientloginsessions       |
| clients                   |
| configuration             |
| consolesessions           |
| crontab                   |
| customemailtemplates      |
| dnsplans                  |
| dnsservergroups           |
| dnsservers                |
| emailtemplates            |
| ftpservers                |
| hvmtemplates              |
| inet6                     |
| inet6assignedips          |
| internalips               |
| ipaddresses               |
| ipblocknodes              |
| ipblocks                  |
| ipv6                      |
| isos                      |
| keymaps                   |
| kvmdata                   |
| kvmtemplates              |
| license                   |
| links                     |
| mediagroups               |
| mediasync                 |
| migrations                |
| migrations_exthdd         |
| nodegroups                |
| nodes                     |
| pdns                      |
| plans                     |
| proxydomains              |
| reinstalls                |
| s_bandwidth               |
| secondaryhdd              |
| serial_console_connections |
| smslog                    |
| syscheck                  |
| systememails              |
| systemmessages            |
| templates                 |
| updater                   |
| version                   |
| vncsessions               |
| vserver_tmp_speed         |
| vservers                  |
| vzdata                    |
| xendata                   |
+----------------------------+
66 rows in set (0.01 sec)

Describe vserver table:

MariaDB [1i20xjD04BjbwkP] desc vservers;
+---------------------+--------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+--------------+------+-----+---------------------+----------------+
| vserverid | int(11) | NO | PRI | NULL | auto_increment |
| clientid | int(11) | NO | MUL | NULL | |
| ctid | int(11) | NO | | NULL | |
| nodeid | int(11) | NO | MUL | NULL | |
| mainipaddress | varchar(30) | NO | | NULL | |
| consoleusername | varchar(100) | NO | | NULL | |
| consolepassword | varchar(200) | NO | | NULL | |
| hostname | varchar(100) | NO | | NULL | |
| disabled | int(1) | NO | | 0 | |
| disabledreseller | int(1) | NO | | 0 | |
| type | varchar(20) | NO | | openvz | |
| disk | varchar(30) | NO | | NULL | |
| diskused | int(100) | NO | | NULL | |
| bandwidth | varchar(100) | NO | | NULL | |
| bandwidthused | text | NO | | NULL | |
| ram | varchar(30) | NO | | NULL | |
| burst | varchar(30) | NO | | NULL | |
| ramused | text | NO | | NULL | |
| template | varchar(200) | NO | | NULL | |
| templatename | varchar(200) | NO | | NULL | |
| rootpassword | varchar(200) | NO | | NULL | |
| bwsuspend | int(1) | NO | | 0 | |
| networkspeed | int(10) | NO | | 0 | |
| cachestatus | varchar(30) | NO | | NULL | |
| qbackup | int(1) | NO | | 0 | |
| bwemailone | int(1) | NO | | 0 | |
| centralbackup | int(20) | NO | | 0 | |
| centralbackupserver | int(20) | NO | | NULL | |
| notes | text | YES | | NULL | |
| templateid | int(11) | NO | | 0 | |
| kernel | int(11) | NO | | 0 | |
| extra | text | NO | | NULL | |
| mediagroups | text | NO | | NULL | |
| pxeenabled | int(1) | NO | | 0 | |
| unsuspendontally | int(1) | NO | | 0 | |
| bwover | varchar(20) | NO | | 0 | |
| widgetlayout | varchar(400) | NO | | NULL | |
| kvmswap | varchar(10) | NO | | 1024 | |
| creationdate | timestamp | NO | | CURRENT_TIMESTAMP | |
| reinstalldate | timestamp | NO | | 0000-00-00 00:00:00 | |
| fstype | int(1) | NO | | 0 | |
| noipv4 | int(1) | NO | | 0 | |
| claimv6back | int(1) | NO | | 0 | |
| reinstallpm | int(4) | NO | | 30 | |
| rescue | int(2) | NO | | 0 | |
| rescuepass | varchar(15) | NO | | NULL | |
| rescuemode | tinyint(3) | NO | | 0 | |
| rescuemodepassword | varchar(150) | YES | | NULL | |
+---------------------+--------------+------+-----+---------------------+----------------+
48 rows in set (0.00 sec)

Select virtual server required from vservers table:

MariaDB [1i20xjD04BjbwkP] select * from vservers where vserverid = 66;
+-----------+----------+------+--------+----------------+------------------+--------------------------+--------------------+----------+------------------+------+-------------+----------+---------------------+---------------+------------+-------+---------+----------+-----------------------------------------+--------------------------------------+-----------+--------------+-------------+---------+------------+---------------+---------------------+-------+------------+--------+-------+-------------+------------+------------------+--------+--------------+---------+---------------------+---------------------+--------+--------+-------------+-------------+--------+------------+------------+--------------------+
| vserverid | clientid | ctid | nodeid | mainipaddress | consoleusername | consolepassword | hostname | disabled | disabledreseller | type | disk | diskused | bandwidth | bandwidthused | ram | burst | ramused | template | templatename | rootpassword | bwsuspend | networkspeed | cachestatus | qbackup | bwemailone | centralbackup | centralbackupserver | notes | templateid | kernel | extra | mediagroups | pxeenabled | unsuspendontally | bwover | widgetlayout | kvmswap | creationdate | reinstalldate | fstype | noipv4 | claimv6back | reinstallpm | rescue | rescuepass | rescuemode | rescuemodepassword |
+-----------+----------+------+--------+----------------+------------------+--------------------------+--------------------+----------+------------------+------+-------------+----------+---------------------+---------------+------------+-------+---------+----------+-----------------------------------------+--------------------------------------+-----------+--------------+-------------+---------+------------+---------------+---------------------+-------+------------+--------+-------+-------------+------------+------------------+--------+--------------+---------+---------------------+---------------------+--------+--------+-------------+-------------+--------+------------+------------+--------------------+
| 66 | 1 | 0 | 2 | 192.168.0.1 | testing123ictupe | VppVip4PRVsO3CPEX6Uq0Q== | testing123.ictu.uk | 0 | 0 | kvm | 10737418240 | 0 | 1073741822926258176 | 7941974 | 1073741824 | 0 | | | CentOS 7 - 64 Bit - Install Puppet Auto | lY5y9Q8flcYhfhd+insSbp+iGPXaWx/TnrY= | 0 | 0 | online | 0 | 0 | 0 | 0 | NULL | 0 | 0 | | 1,2 | 0 | 0 | 0 | | 1024 | 2018-11-10 07:35:40 | 0000-00-00 00:00:00 | 0 | 0 | 0 | 30 | 0 | | 0 | NULL |
+-----------+----------+------+--------+----------------+------------------+--------------------------+--------------------+----------+------------------+------+-------------+----------+---------------------+---------------+------------+-------+---------+----------+-----------------------------------------+--------------------------------------+-----------+--------------+-------------+---------+------------+---------------+---------------------+-------+------------+--------+-------+-------------+------------+------------------+--------+--------------+---------+---------------------+---------------------+--------+--------+-------------+-------------+--------+------------+------------+--------------------+
1 row in set (0.00 sec)

Set new template ID for Virtual server in question:

MariaDB [1i20xjD04BjbwkP] update vservers set templateid = '1' where vserverid = 66;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

You should now be able to delete the template from SolusVM backend as none of the Virtual Servers are now assigned to that template.

ICTU LTD is a company registered England and Wales (Company No. 09344913) 15 Queen Square, Leeds, West Yorkshire, England, LS2 8AJ
Copyright © 2024 ICTU LTD, All Rights Reserved.
exit