PI System Administration Beyond the Basics
PI System Administration Beyond the Basics
Alex Duhig
V2021r2 / 9-Aug-2021
© 2021 AVEVA Group plc and its subsidiaries. All rights reserved.
AVEVA, the AVEVA logos and AVEVA product names are trademarks or registered trademarks of aveva group plc or its subsidiaries
in the United Kingdom and other countries. Other brands and products names are the trademarks of their respective companies.
aveva.com
PI System Administration: Beyond the Basics PAGE 2 OF 29
Table of contents
1 INTRODUCTION ..................................................................................................................................... 4
1 Introduction
Before reading this section, please refer to the following course YouTube video:
https://youtu.be/OE1YKqwD5i8
This course will teach PI System Administrators to upgrade, expand, and improve the reliability on the core components
of a PI System, including:
During the class we'll cover best-practise configuration only, but will link out to documentation covering older practises
and methods when necessary - although we will discuss migrating to modern best practises from outdated practises in
detail.
Throughout this class we will assume you have already completed the PI System Basics and PI System Administration:
Basics classes. We will not cover any background or content that has already been covered in these classes.
The course consists of text-based lessons, and video lectures. You are encouraged to follow along with all video lectures
using your Learning Cloud Environment. It is intended that you follow the video lectures in-order, as a lot of
configuration depends on prior lessons. Text-based lessons contain background theory, exercises, documentation and
other useful information.
• Hands-On: These lessons contain hands-on walkthroughs on configuring your virtual environment. Skipping
these videos is not recommended, you will find that you cannot complete some later lessons without first
completing the earlier ones. Throughout these sections we will link out to reference documentation. You may be
examined on the content inside these references, but as the exam is open-book, you're welcome to visit these
references during the exam.
• Knowledge check: Exercises to complete using your virtual environment, or quizzes to keep your skills sharp.
Lessons will assume you have completed prior knowledge checks. Some knowledge checks ask you to change
the configuration of your virtual environment and skipping them may result in you being unable to complete
later exercises.
• Background: Readings or videos containing useful background information to assist your understanding. These
lessons are optional, but encouraged as they will give you a more well-rounded understanding of the system.
In the next lesson we'll cover the Learning Cloud Environment used in class, and what we'll accomplish in this class in
detail.
Before reading this section, please refer to the following course YouTube video:
https://youtu.be/io_5WDrjtdY
Software Version
2 Configuring Security
2.1 Background: Upgrading and Migrating Interfaces
References (Login required):
• What are the steps for upgrading PI Interface for OPC DA?
• How to move an interface to a new machine
One of the most stressful tasks of a PI System Administrator is moving an interface from one machine to another, or
upgrading one in place to a new version. Interfaces are commonly the most important link in the chain of data flow
PI System Administration: Beyond the Basics PAGE 6 OF 29
through the system, any downtime for them typically means data loss - the worst possible outcome for a PI System
Administrator.
As with all Interface administration tasks, moving or upgrading interfaces gets much less risky when you have a failover
pair. If you have a pair of interfaces in failover, the update process is fairly simple:
1. Download the latest version of the interface installer from the OSIsoft Customer Portal
2. Stop the interface on one of the interface machines
3. Run the new version of the installer on the machine, and go through the installation wizard
4. Start the updated interface
5. Stop the interface on the second machine and ensure the updated interface takes over and is sending data to
the Data Archive
6. Run the new version of the installer on the second machine, and go through the installation wizard
7. Start the second interface
8. Restart the first interface and ensure the second takes over and is sending data to the Data Archive
See the references above for moving an interface to new hardware, or for details on how to reduce data loss if you do
not have a failover pair set up. There is one more interface maintenance task that is a little more involved. Moving from
one interface type to another on the same machine. The most common reason you would do this is to move from the
Read-Write version of an interface to the Read-Only version, in effort to harden security in the system. This course aims
to prepare you to harden the security of your PI System - and it's exactly what we're going to do in our first hands-on.
During this section, please refer to the following course YouTube video:
https://youtu.be/g8gC-FdCX5k
In this hands-on, we will migrate a read/write version of the OPC interface to a read-only version. In doing this, we’ll also
get experience in interface management and maintenance. During the hands-on we use login credentials, these can be
found in the previous "Credentials Used in this Class" chapter.
References:
• Documentation for the PI Interface for OPC DA can be found here, definitions for the parameters found in the
configuration file can be found here.
3. Click Connect
2. Open the shortcut to PI Install Kits on the desktop
3. Right click on OPCInt_ReadOnly_2.X.X.X_.exe → Run as Administrator
4. Click OK and Next through the installer until it completes
• Authentication is the process that verifies the identity of a user or process, before allowing it to connect to the
Data Archive
• Authorization is the process that determines what an application can do once connected to the Data Archive or
the Asset Framework (e.g. create a PI Point, create an asset, run a backup, etc.)
We like to make an analogy of the Data Archive (or the Asset Framework) as a building. The process of authentication is
like the security guard at the entrance of the building. They decide whether you should be let in. If they do let you in,
you are given an access card. This access card is your authorization. It will give you access to specific rooms within the
building.
In the Basics class we covered authorization, but skipped over most of authentication, mostly because only one of the
types is considered best practise - so we ignored the others. In this class we're covering upgrading and moving from
legacy security, so we should know an little bit more about what's out there.
2.3.1 PI Mappings
PI Mappings use Windows Integrated Security to authenticate users on the Data Archive. With this method, users and
services connect directly to the Data Archive using their Windows account. A PI Mapping grants a Windows user or
group specific rights on the Data Archive by assigning a PI Identity.
This method of authentication has several advantages:
• It is the most secure
• It enables transport security (encryption in transit) of communications with the Data Archive
• It represents the least amount of maintenance for PI System administrators
• It allows users to connect directly with their Windows accounts
The recommended strategy for using PI Mappings is to create a Windows Group for each level of authentication needed
on the Data Archive (e.g. one group for Read-Only users, one group for PI System Administrators, etc.), then assign a
unique PI Identity to each one of these groups.
PI Mappings are created from System Management Tools, from Security > Mappings & Trusts > Mappings Tab, by
pressing the New button . This will open the Add New Mapping Window
PI System Administration: Beyond the Basics PAGE 9 OF 29
• The application must connect with PI AFSDK (any version), PI SDK version 1.3.6 or later or the PI API for
Windows Integrated Security (version 2.0.1.35 and later, released in 2016)
• The connecting application is running on a Windows operating system
2.3.2 PI Trusts
PI Trusts should NOT be used unless it is not possible to authenticate using Windows Integrated Security. We'll discuss
scenarios in which you would use trusts in the next lesson.
Note: Prior to 2016 release of the PI API for Windows Integrated Security, any applications using the PI API, such as PI
Interfaces, could not use PI Mappings. Now, almost all PI Interface nodes can be upgraded to the new security model,
regardless domain or workgroup configuration.
The PI Trust authentication method works by comparing some connection metadata of the connecting application to the
metadata saved in PI Trusts. If the the metadata matches one of the configured trusts, the connection is allowed. No
login is required by the application.
PI Trusts are created from System Management Tools, from Security > Mappings & Trusts > Trusts Tab, by pressing the
arrow next to the New… button and selecting the advanced option:
It is not necessary to fill in all of the information in this Window. OSIsoft recommends that you fill out PI Trusts using the
2+ Trust convention. This means you need to enter the following:
• The IP Information:
o The Network Path (Host name or fully qualified domain name of the computer)
OR
o The IP Address and a NetMask of 255.255.255.255.
• The Application Information: The application name. Applications that connect through the PI API send an
identifier called an application process name, or procname. This is a four-character string with an E appended.
For example, the procname for the PI Perfmon interface is PIPeE.
simple client PC. We're using PI SDK Utility - a simple little application installed on any PI System client PC that allows a
connection test, and the viewing of log files.
1. Connect to PISQL01,
2. Through the Start menu, open PI System → PISDKUtility (64-bit)
3. Navigate to the PI SDK → Connections
4. Open from the top menu: Connections → Options
The connection options box can be opened from many PI System clients, and shows the options the client machine uses
when it connects to Data Archives. Here's where we could change the default server clients use on this machine when
making their initial connection to a server, and change the preferred order of authentication protocols. Note that all
settings here are for this client PC only - they're not server side settings. If you would like to push these connection
settings to many client PCs at once, an article covering this can be found here (login required).
This is the default order of connections for a client. It will first try to connect with Windows Security, then with a PI
Trust, then with "Default User". If all of these fail, then it pops up a login prompt. By now we know what Windows
Security and PI Trusts are. Default User and Login prompt refer to the Explicit Login method described in the previous
lesson. They're not used in modern systems, and should not be used due to large management overhead and security
reasons. This method is turned off on the Data Archive by default.
5. Click OK
6. Click the Checkbox next to PISRV01. It should successfully connect. Note the connected user is listed as
PISCHOOL\student01 as piadmins.
7. Open a virtual machine connection to PISRV01
8. on PISRV01, through the Start menu, open PI System → PI System Management Tools
9. Navigate to Operation → Message Logs
10. Click the magnifying glass to retrieve log messages
11. Find the message associated with the connection from PISQL01. It should look something like this:
This message indicates that a mapping was used to authenticate this connection, and the user connected was
PISCHOOL\student01. Let's try using a trust.
PI System Administration: Beyond the Basics PAGE 12 OF 29
We just created a 2+ trust. A trust that uses at least two pieces of connection metadata to authenticate incoming
connections. Let's test it out.
17. On PISQL01, in PI SDK Utility, uncheck the box next to PISRV01, then check it again
18. Note that we still connect as a Windows User
19. Check the log on PISRV01 inside SMT, note that we're still using a mapping rather than a trust
What's wrong? Has our configuration failed? It hasn't, it's just that the connection protocol order prefers Windows
authentication, so will connect using that if possible. Let's change it.
One important thing to note: the user here is what will be printed on subsequent log messages when this user performs
tasks. This is one of the primary reasons you should never use trusts for user connections. There's no way to audit or
identify who made changes to teh system if multiple users are trusted to the same identity.
Now... let's remove this trust. I'm uncomfortable just looking at it.
25. On PISRV01, in SMT, navigate to Security → Mappings & Trusts, Trusts tab
PI System Administration: Beyond the Basics PAGE 13 OF 29
Our PISDKUtility attempted to connect using a trust, which failed. Then it tried using Windows authentication, which
succeeded. This is because we had trust first in our protocol order.
30. On PISQL01, in PI SDK Utility, go to Connections → Options and change the protocol order back so Windows
Security is at the top
Most clients connecting to the Data Archive use this protocol order to decide how they connect, and it can be changed
through this Connections → Options window. The notable exception for this is interfaces. Interfaces ignore this setting,
and will behave like so:
• If PI API for Windows Integrated Security is installed on the interface machine, the interface will only connect
using Windows Security
• If PI API for Windows Integrated Security is not installed on the interface machine, the interface will only
connect using Trusts
In the next lesson we'll talk about possible scenarios that may force you to use trusts over Windows Security.
There are some specific situations where you must use trusts:
That's it. Only two real dealbreakers. They come up very rarely nowadays. If you must use trusts, you should follow the
practises set out in this article (login required) under the section "More Specific Trusts – Multiple Credentials". These are
sometimes called "2+ Trusts".
PI System Administration: Beyond the Basics PAGE 14 OF 29
So why are so many organisations still using trusts? The following is a summary of reasons why a lot of organisations
stick to trusts and will not move to mappings:
This is the most straightforward to fix - attend a class like this, and ensure that either you're never in a situation where
you need to move (you use best practises during installation), or move your system over after completion of this course.
Organisation policies may not allow accounts with non-expiring passwords to be created
A lot of organisations have a blanket rule, stating that accounts with passwords must expire after a time period. This
makes it infeasible to manage the different service account passwords on individual interface machines. It's hard to
work around this other than trying to change the policy itself. Policies like this are outdated and go against modern
password practises like those suggested by NIST. If your organisation has policies like this, start a conversation with your
IT department asking why they are in place, and if they should be reviewed with modern guidelines in mind.
All in all, the risk caused by an old password being used by an interface is far less risky than using a trust. If the two are
compared, there's no contest as to which is preferable when looking objectively.
Imagine you have your interface on a process control network with its own domain, pushing data to a Data Archive on
the corporate network. This works just fine, and is a very common topology. The configuration we went through in this
course is what is recommended; use Windows Credential Manager to have the interface log in to the Data Archive using
a domain account.
The complication comes when you think about your administration team. Your admin team would have individual
accounts on the process control network (PCN) domain, and different individual accounts on the corporate domain.
When an administrator needs to make a change to an interface, they must start up the ICU, which needs to log in to the
PI Data Archive with close-to admin rights. Your administrators would need to run the CMDKEY command, mapping their
PCN account to their corporate account after they log in.
Now imagine you have hundreds of interfaces, and a large group of administrators. It becomes frustrating and time
consuming for administrators to map credentials whenever they log in to any interface node. You may also feel
uncomfortable having admins map their corporate credentials from a different domain.
There's no easy solution for this problem. Security is always a balancing act between security and convenience. If the
above manual mapping won't work for you, other options along the security/convenience spectrum are:
• Use trusts, following the practises set out in this article (login required) under the section "More Specific Trusts –
Multiple Credentials". These are sometimes called "2+ Trusts". Going with this option sacrifices the the benefits
of over-the-wire encryption for interface connections, and increases attack surface as trusts cannot be disabled.
• Instead of using the ICU, manually manage interface and buffer configuration files. Administrators would need
to regularly reference the documentation for the interface they are configuring, and documentation and articles
on buffer configuration. Going with this option
• Create a shared account on the PCN domain, limited to only being able to run the ICU. Create a CMDKEY entry
for this account to a corporate domain account with minimum privileges that the ICU needs.
PI System Administration: Beyond the Basics PAGE 15 OF 29
During this section, please refer to the following course YouTube video:
https://youtu.be/6cfAX1RCkL4
In this hands-on, we will configure secure cross-domain access for an interface on a machine that is not a member of the
same domain as the PI Data Archive. During the hands-on we use several different login credentials, these can be found
in a table on the online version of this lesson. When this exercise mentions “the table above”, it is referring to the table
on the online version of the lesson.
1. Connect to PIINT01
2. Open the PI Install Kits shortcut on the desktop
3. Right click on PIAPI.X.X.X.exe → Run as Administrator
4. Click OK
5. Click Install
6. Click OK or Next on all further prompts during the install
7. If asked to reboot, say Yes
Before reading this section, please refer to the following course YouTube video:
https://youtu.be/Kolx8Q1ohBI
References:
• You can read more about Data Archive and AF high availability here.
• For directions on installing the backend Asset Framework (AF) database on a SQL Server availability group
(highly available SQL Servers) see the documentation here.
• In this course we only cover the recommended AF High Availability (HA) solution - Load Balanced AF Servers. For
full documentation including other options for AF HA see the documentation here.
During this section, please refer to the following course YouTube video:
https://youtu.be/6cfAX1RCkL4
In this hands-on we’ll install Asset Framework and set up a backend database on a remote server.
PI System Administration: Beyond the Basics PAGE 18 OF 29
References:
• SQL Server versions supported by AF are detailed here.
• Installation of AF on SQL backends with different highly available architectures can be found here - Availability
groups, Mirrored, Failover Clusters. Directions on installation can be found in the chapters of these
documentation sections.
cd Desktop
cd SQL
go.bat PISQL01\SQLEXPRESS PIFD
1. Connect to PISQL01
2. Click the Start menu, then open Microsoft SQL Server Tools 18 → Microsoft SQL Server Management Studio
3. Click Connect
4. Expand Security
5. right click on Logins → New Login...
6. Click Search...
7. Click Locations...
8. Select the Entire Directory then click OK
9. Click Object Types...
10. Check the box next to Service Accounts then click OK
11. Enter the object name: "PISCHOOL\SVC-PIAF$", then click OK
12. Click User Mapping
13. Check the box next to PIFD
14. Check the boxes next to:
o db_AFQueryEngine
o db_AFServer
[Note - this step is actually incorrect. We'll fix this in the next exercise. Assign these permissions now
anyway so you're ready to fix them the next exercise!]
15. Click OK
Our RTQP service runs on the PISCHOOL\SVC-PIRTQP$ account, but we configured security for the PISCHOOL\SVC-PIAF$
account. If anyone tried to use our RTQP service right now, they'd fail to connect. If you're interested in exactly what this
service does, feel free to read through the documentation here, or take a look at our course on Exposing PI Data with
the PI SQL Framework. In simple terms, it exposes the AF server as if it were a SQL server, allowing users to run SQL
queries to extract PI Data.
The RTQP service requires direct access to the AF backend database, with slightly different permissions than the AF
Server. When users run queries against the engine, it executes queries against the SQL backend database. It will also
connect to the Data Archive and retrieve any data it needs to service user queries. You should never execute queries
against the AF SQL backend database itself to retrieve your AF hierarchy or production data, this should all be done
through the RTQP or similar services. The only reasons to connect to the backend database directly is during this initial
setup, or to back up or move the database.
If you're expanding your architecture from a single Data Archive to a collective and adding to your license, you'll need to
update the license on your primary with the new license that supports the second collective member. You can generate
a new Data Archive license on the customer portal by uploading a Machine Signature File from your primary archive and
downloading a new license file. The package downloaded will contain a pilicense.dat (which should be used on your
primary Data Archive machine) and temporarylicense.dat (which should be used on any secondaries). More information
can be found in the documentation.
2. Update your existing Data Archive license on your primary archive machine, or install a PI Server using this new
license
3. Ensure appropriate firewall ports are open on the primary and secondary machines. A full list of ports can be
found here.
4. Ensure your user account has the permissions needed to set up the collective. You can read the requirements
here.
During this section, please refer to the following course YouTube video:
https://youtu.be/_ykO3UMvFyw
In this hands-on we’ll configure redundancy for both the Data Archive and AF Server
References:
• In the video we mentioned pushing out known servers table updates to all users on your network. For more
information this, see this article (login required).
• For the privilege required for creating a Data Archive collective, see the documentation here.
• For more information about managing collectives with PI Collective Manager, see the documentation here.
• We mentioned creating analytics, events and notifications during the video. These topics are covered in courses
in our Power User training path, and official documentation for these features can be found here.
Again, our task is simple. Make PIINT01's pibufss and interface services use the correct credentials when logging in to
the secondary Data Archive.
Note: We haven't mentioned backups for a redundant set of AF servers, but the procedure is the same as with a single
AF Server - simply back up the PIFD backend database.
cd /d "%piserver%adm"
pibackup e:\pibackup -install
4. Connect to PISRV02
5. Open a Windows Command Prompt
6. Run the commands:
cd /d "%piserver%adm"
pibackup e:\pibackup -install
7. Open the start menu and type "Task Scheduler", and run Windows Task Scheduler
8. Navigate to Task Scheduler Library
9. Right click on PI Server Backup → Properties
10. On the Triggers tab, select the Daily schedule and click Edit...
11. Change the time to 3:45AM, then click OK
12. Click OK
Note: Step 1b in the Analysis security configuration procedure has you configure read/write access to the PIPoint
database, so the Analysis service can create its own points. While this is functionality the Analysis service has, it is best
security practise to only give the service read access to the database, and have your administrators create points for the
service using PI System Explorer or PI Builder. Allowing the Analysis service to create its own points effectively allows
anyone that can edit the AF database the ability to create points, which can enable accidental (or intentional) changes to
PI Points through the service.
You do not need to configure security for the AF side of things - when we ran the PI Server installer and specified which
accounts we'd like to run these services, the installer automatically configured these mappings.
HINT: you only need to modify identities, mappings, and tag configuration on the primary, all changes will be
automatically synchronised over to the secondary.
PI System Administration: Beyond the Basics PAGE 26 OF 29
Optional: If we were to strictly follow best practises, we would now open Excel and use PI Builder to give the new
identities Read access to PointSecurity and DataSecurity for all points. Modifying the PIPOINT database security doesn't
modify the security for all points, but only the default security for new points. However, we haven't disabled PI World
access to our server, so the services already have this access to all points. We'll skip these steps, as the Basics class
covered them at length.
HINT: Refer to the lesson "The Bufferer, the Better" in PI System Administration: Basics for inspiration on all the
configuration you need to do.
Now we've configured buffering, we need to make sure it connects to the PI Data Archive using an account that can
write to analysis points. In an earlier exercise, we configured the SVC-PIANALYT group managed service account to have
these privileges.
8. Open the Windows Services panel by clicking on the icon for it in the taskbar
9. Modify the PI Buffer Subsystem service so it logs in as the PISCHOOL\SVC-PIANALYT account (hint: this account
is a group-managed service account so you may need to do special things with dollar signs and passwords. If you
don't know what to do, the configuration is very similar to the configuration we did in the interface buffering
video, but with a different account this time).
10. Create a service dependency for PI Analysis Service on PI Buffer Subsystem to ensure that PI Buffer Subsystem
starts first on machine start. To do this, run Windows command prompt with the icon in the taskbar and
execute the following command:
11. Open Computer Management from the Windows Start menu. Navigate to System Tools → Local Users and
Groups → Groups
12. Double click on the PI Buffering Administrators group, and add the SVC-PIANALYT account to the group
13. Use the Windows Services panel to restart the PI Buffer Subsystem service. It should warn you that it will
restart the PI Analysis service as well.
14. Close and reopen Buffering Manager. The status indicator should be green if you have configured buffering
correctly.
During this section, please refer to the following course YouTube video:
https://youtu.be/CpS62V-CCzM
References:
• Documentation on available connectors can be found under the "Connectors" section of this page
• For directions on how to move the Analysis service to a new machine, see here
• Documentation on installing the Analysis service on a Windows Failover Cluster can be found here
• Documentation on installing PI Vision can be found here
PI System Administration: Beyond the Basics PAGE 29 OF 29
4 Final Exam
The final exam in this course is taken online. Please check the course listing online for more details.