Skip Navigation LinksALVAO 11.1ALVAO Asset ManagementImplementation of the system in the organisationInstallationMultitenant mode Skip Navigation Links.


Multitenant Mode

In multitenant mode, one installation of ALVAO Server serves several customers (tenants).

Creating a tenant database

Create a tenant database on SQL Server by running a script (e.g. from SQL Server Management Studio):

create database AlvaoTenants
go
use
AlvaoTenants
go
create table
Tenant (
    id
int identity(1,1) constraint PK_Tenant_id primary key clustered,
    Organization
nvarchar(255),
    Domain
nvarchar(255),
    ConnectionString
nvarchar(max),
    IsProvider
bit not null default (0)
)
Note:
It is executed only once.
Note: On Azure SQL Server, run the script in two separate steps:
  1. Create tenant database (create database AlvaoTenants).
  2. Connect to the new database and create a table of tenants (create table Tenant (...)).
Note: On SQL Server, set the necessary permissions for IIS processes. For the tenant database, you need to enable the db_datareader user role.

Setting multitenant mode

Asset Management WebService

  1. Edit the web.config file, e.g. using Notepad.
  2. Find the section configuration/connectionStrings.
  3. In this section, replace the existing connection with the new one. Replace it with a connection named AlvaoTenants that contains a connection string to the tenants database.
    Example:
    <add name="AlvaoTenants" connectionString="Data Source=server1;Initial Catalog=AlvaoTenants; Max Pool Size=2000; Integrated Security=True" providerName="Microsoft.Data.SqlClient"/>
Note:
If AM WS is running in multitenant mode, it saves the files received by detection in the folder by default:
c:\ProgramData\ALC\ALVAO Asset Management Collector\Detections\<tenant organization name>

Asset Management Collector

For multitenant mode, first prepare a ZIP package to install service instances for each tenant:

  1. Install the MSI package AlvaoAssetCollector.msi using the "admin" installation:
    msiexec /a AlvaoAssetCollector.msi
    Note: Run the command line "as administrator".
  2. In the folder where you installed the package (where the EXE and DLL libraries of the application are), extract the contents of the package CollectorServiceControlScripts.zip
  3. Then "zip all the files" and create one ZIP archive, e.g.: . AMCollector.zip

Alvao Service

  1. Edit the appsettings.json file, e.g. using Notepad.
  2. Find the ConnectionString section.
  3. In this section, replace the existing connection with the new one. Replace it with a connection named AlvaoTenants that contains a connection string to the tenants database.
    Example:
    "AlvaoTenants": "Data Source=localhost;Initial Catalog=AlvaoTenants; Max Pool Size=2000; Integrated Security=True; MultipleActiveResultSets=True"
                
  4. Note:
    On SQL Server, set the necessary permissions for Alvao Service. The settings for the tenant database are the same as for the database in single tenant mode. The recommended user roles are db_datareader, db_datawriter, db_ddladmin, db_owner and db_executor.

WebApp

  1. Edit the Web.config file, e.g. using Notepad.
  2. Find the section connectionStrings.
  3. In this section, replace the existing connection with the new one. Replace it with a connection named AlvaoTenants that contains a connection string to the tenants database.
    Example.:
    <add name="AlvaoTenants" connectionString="Data Source=server1;Initial Catalog=AlvaoTenants; Max Pool Size=2000; Integrated Security=True" providerName="Microsoft.Data.SqlClient"/>

Custom Apps WebService

This component is installed only for tenants who have purchased the ALVAO Asset Management Custom Apps or ALVAO Service Desk Custom Apps module.

For multitenant mode, first prepare a ZIP package to install service instances for each tenant:

  1. Install the MSI package AlvaoCustomAppsWebService.msi using the "admin" installation:
    msiexec /a AlvaoCustomAppsWebService.msi
    Note:
    Run the command line "as administrator".
  2. 2. "Zip" the folder from IIS where the application was installed (e.g. C:\inetpub\wwwroot\AlvaoCustomAppsWebService) and create a single ZIP archive, e.g. CustomAppsWebService.zip

Adding a new tenant

  1. For a new customer, register a new (sub)domain in DNS (e.g. zakaznik1.alvao.com) that points to the IP address of the server with the Alvao web applications installed.
  2. On SQL Server, use the DatabaseDeploy utility to create a DatabaseDeploy for customer . new database in the appropriate language (according to the customer's requirement). Activate the database.
    Note:
    • The name of the database is recorded as case sensitive text, so be sure to observe case when transcribing.
    • When a new database is created, a strong authentication code is automatically generated for AM Agents. The code can be changed in global detection settings.
    Note:
    On SQL Server, set the necessary permissions for IIS processes. The settings for the tenant database are the same as for the database in single tenant mode. The recommended user roles are db_datareader, db_datawriter, db_ddladmin, db_owner and db_executor.
  3. Go to the AlvaoTenants database, e.g. using SQL Server Management Studio, edit the Tenant table and insert the corresponding values into it.
    Ex:
    • Organization = Customer 1
    • Domain = zakaznik1.alvao.com
    • ConnectionString = Data Source=server1;Initial Catalog=Zakaznik1; Max Pool Size=2000; Integrated Security=True;TrustServerCertificate=True

Provider Alvao

One of the tenants can be designated as an Alvao provider.
The provider has the right to create News for other tenants as well.
To designate a provider, set the IsProvider column in its row in the tenant database to 1.

Asset Management Collector

  1. Create a new folder with the name of the tenant in C:\Program Files (x86)\ALVAO\ Asset Management Collector\
    E.g.: Customer 1
  2. Extract the ZIP package with the AMCollector.zip files (see Multitenant Mode Settings) into this folder.
  3. Edit the AMCollector.config file and set the connection string to the tenant database in the configuration/database/connectionStrings section.
  4. Run the CreateService.cmd script ("as administrator") to create the AM Collector service for the tenant. The script will start the service directly.
    Note:
    For the proper functioning of the service, we recommend creating a service account to which you assign sufficient rights to manage the database. The tenant can then be easily identified in the services.
    Note:
    For proper functioning of the service, we recommend creating a service account to which you assign sufficient rights to manage the database (i.e. the right db_ddladmin, db_datawriter, db_datareader and db_executor). Then run all Collector services under this account. Be sure to also allow this account access to the folders from where it will perform file retrieval. This is the "C:\Windows\Temp" folder and the hidden "C:\ProgramData\ALC" folder.
  5. Go to the tenant's Alvao WebApp and in Management - Asset Management - Servers create settings for the specific server.
    • Enter the name on the network of the server running Alvao services.
    • In the File Loading section, enable automatic loading of CXM files from the folder:
      c:\ProgramData\Alvao Asset Management Collector\Detections\<tenant organization name>

Custom Apps WebService

  1. On IIS, create a new folder named AlvaoCustomAppsWebService_<tenant name without hooks, commas, spaces and other special characters>, e.g.:
    C:\inetpub\wwwroot\AlvaoCustomAppsWebService_Zakaznik1
  2. Extract the ZIP package CustomAppsWebService.zip (see Multitenant Mode Settings) into this folder.
  3. Edit the web.config file, e.g. using Notepad. Find the section configuration/connectionStrings and set the connection string to the tenant database.
  4. Create an application pool specifically for this tenant's Custom Apps WebService with the same settings, as the other Alvao apps. Leave the pool identity at ApplicationPoolIdentity.
  5. On SQL Server, set the IIS APPPOOL account with db_datareader, db_datawriter, and db_executor permissions for the tenant database only.
  6. In the IIS Manager, select the newly created folder and select Convert to Application from the context menu. Select the application pool created in the previous steps and confirm the dialog by pressing OK.
  7. Enter the correct service address in the following SQL script and run the script on the new tenant's database:
    exec spUpdateInsertProperty 'CustomAppsWebService.Url', 'https://<server>/CustomAppsWebService_Zakaznik1'

Distribution of AM Agents

Install AM Agents on computers in your organization with the following command line parameters:

  • WSURL=<address of the AM WS with a specific tenant (sub)domain>, e.g.: https://zakaznik1.alvao.com/AssetWebService/AssetWebService.asmx
  • AUTHCODE=<authentication code>
    Note:
    The Agent Authentication Code was generated automatically when the DB was created. You can find it in global detection settings.
Note:
Agents can also be extended using GPOs with preset parameters - see Installation via GPO, or other tools.

Tenant Upgrade

All tenants on a particular server must be upgraded at the same time because they share common server applications. If you need to upgrade only some tenants, you must first move them to another server.

Upgrade Database

If you need to upgrade the database (installing SP1 or a new "big" version), use the DatabaseDeploy utility to upgrade all tenants' databases to the new version.

Asset Management WebService

  1. Install the new version of AM WS.
Note:
AM WS is common for all tenants on a given server.

Asset Management Collector

  1. Re-create the ZIP package for the current version of Alvao, see above.
  2. In Windows - Computer Management - Services and Applications - Services, stop the AM Collector services for all tenants.
    Note: That is, all AM Collector services that have the organization name in parentheses at the end of the service name.
  3. Extract the prepared ZIP package without the AMCollector.config file into the folders of all tenants one by one, so as not to overwrite the instance settings.
  4. Start all services again.

Alvao Service

  1. Install a new version of Alvao Service.
Note:
Alvao Service is common for all tenants on a given server.

WebApp

  1. Install a new version of WebApp.
Note:
WebApp is common for all tenants on a given server.

Custom Apps WebService

  1. Re-create the ZIP package for the current version of Alvao, see above.
  2. Extract the prepared ZIP package without the web.config file into the tenants folders one by one, so that the instance settings are not overwritten.

Removing a tenant

  1. Go to the AlvaoTenants tenant database and edit the Tenant table, find the correct tenant and delete the entire row.
  2. On the SQL server, delete the Alvao database for the tenant.

Asset Management Collector

  1. Go to C:\Program Files (x86)\ALVAO\Asset Management Collector\ and find the subfolder of the specific tenant.
  2. In the folder, run the script RemoveService.cmd ("as administrator").
  3. Remove the entire tenant folder.

Custom Apps WebService

  1. In the IIS Manager, delete the tenant application using the Remove command in the local menu.
  2. Remove the application pool for the Custom Apps WebService of this tenant.
  3. In the C:\inetpub\wwwroot folder, delete the instance folder for this tenant.

 

Did not find what you were looking for? Ask our technical support team.