Error "The primary file must be at least 1024 MB to accommodate a copy of the model database" while trying to create the SMP database
search cancel

Error "The primary file must be at least 1024 MB to accommodate a copy of the model database" while trying to create the SMP database

book

Article ID: 161520

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

While trying to install ITMS on a new server, the configuration process is running during the initial installation and a failure occurred while trying to create the new Symantec_CMDB database.

The following error is displayed in the NS logs:

"The primary file must be at least 1024 MB to accommodate a copy of the model database"

Environment

ITMS 8.x

Cause

The model database defaults vary depending on the version of SQL Server. For example, with SQL Server 2016, SQL Server 2017 and SQL Server 2019 the default initial size of both the model database, Primary data (model.mdf) and Log file (modellog.ldf) is 8 MB. The Primary data file is set to Autogrow by 64 MB until the disk is full. The Log file is set to Autogrow by 64 MB to a maximum of 2 TB.

If the file sizes of the model database are too large, there may not be sufficient disk space to create the initial custom database.

In our code, under DBConfiguration.cs, we specify a database size creation of 1000 MB. The new databases will start out no smaller than the Model database. When we create a new database, SQL server uses Model DB as a template. SQL server doesn't like to create a database that is smaller than their Model DB. In this case, the administrator had manually set it to 1024 MB (not the default value) and our installation code was trying to create a 1000 MB database and SQL server displayed the error mentioned above.

Resolution

In this particular instance, changing the Model database size from 1024 MB (or whatever higher value that you may be using) to 3 MB was needed. Then restarting the installation process via SIM and it finished creating the Symantec_CMDB database successfully.  The steps are:

1. Open Microsoft SQL Server Management Studio
2. Under Databases > System Databases, right-click on Model and open Properties.
3. Under 'Files', change the 'Initial Size (MB)' to 3 for example. Click OK.