You are on page 1of 34

USAGE OF POWERFACTORY

– for Individual Grid Model (IGM) generation and Static


Security Analysis in a containerized cloud environment –
based on CGMES profiles
03.05.2023 – Lars Truelsen, Energinet
Agenda

• Energinet – Intro & Task

• Idea

• PoC (Proof-of-Concept)

• Live demonstration

• PoC results

• Questions?

• Bonus info
o Intro to Azure Kubernetes Service
▪ Docker

▪ Kubernetes

▪ AKS

3 MAY 2023
Energinet – Intro

3 MAY 2023
Energinet – Intro

3 MAY 2023
Energinet – Task

With the already high share of renewable, fluctuating and distributed production &
consumption, Energinet is close to the limit on how many Security Analysis’ the Control
Center can perform, due to limitations in the current application & IT-infrastructure setup.

In the coming decade, Energinet will face a dramatic increase in both transmission and
distribution grid connected fluctuating production & consumption which will further
increase the need for more Security Analysis’ to be performed.
• https://energinet.dk/media/y5rhoqjy/pathways-towards-a-robust-future-energy-system_energinet-2023-01-23.pdf

What to do…?
Install more traditional hardware...?
Use modern technology...?

3 MAY 2023
Idea

3 MAY 2023
Idea – Intro Docker

What is Docker?
Docker is a containerization platform used to develop, ship, and run containers. Docker doesn't use a hypervisor, and you can run Docker on
your desktop or laptop if you're developing and testing applications. The desktop version of Docker supports Linux, Windows, and macOS.
For production systems, Docker is available for server environments, including many variants of Linux and Microsoft Windows Server 2016
and above. Many clouds, including Azure, support Docker.

What is an image?
An image is a read-only template with instructions for creating a Docker container. Often, an image is based on another image, with some
additional customization.
The container image becomes the unit we use to distribute our applications.

What is a container?
A container is a runnable instance of an image. You can create, start, stop, move, or delete a container using the Docker API or CLI. You can
connect a container to one or more networks, attach storage to it, or even create a new image based on its current state.

3 MAY 2023
Idea – Intro Kubernetes

What is Kubernetes?
Kubernetes is a portable, extensible, open source platform for managing containerized workloads and services, that facilitates both
declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely
available.

What is Pod?
Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.
A Pod (as in a pod of whales or pea pod) is a group of one or more containers, with shared storage and network resources, and a
specification for how to run the containers. A Pod's contents are always co-located and co-scheduled, and run in a shared context. A Pod
models an application-specific "logical host": it contains one or more application containers which are relatively tightly coupled. In non-cloud
contexts, applications executed on the same physical or virtual machine are analogous to cloud applications executed on the same logical
host.

3 MAY 2023
Idea – Concept

Why not use modern container technologies in order to launch PowerFactory incapsulated in a
Docker image as an “Individual Grid Model (IGM) serializing” & “Security Analysis” engine with CIM
based in- & output – automatically scaled based on demand?

Windows server
Image

PowerFactoryComponent
Python application

“PowerFactoryComponent” is a Python application which is


used to configure the usage of PowerFactory in engine mode
as an “Individual Grid Model (IGM) serializing” & “Security
Analysis” engine – using PowerFactory’s Python API.
3 MAY 2023
Idea – Concept

PowerFactoryComponent
Python application

“PowerFactoryComponent” is a Python application which is


used to configure the usage of PowerFactory in engine mode
as an “Individual Grid Model (IGM) serializing” & “Security
Analysis” engine – using PowerFactory’s Python API.
3 MAY 2023
Idea – Concept Image registry
Windows server

Image
Settings PowerFactoryComponent
Python application

❑ IGM
❑ Security analysis

PowerFactoryOrchestrator
Fetch input data & launch
containers to produce the
desired output Container orchestration system

"PowerFactoryOrchestrator" is a Python application which is:


• monitoring incoming events.
• used to communicate with the Container orchestration
system (e.g. a Kubernetes cluster).
• used to handle/dispatch the number of available
PowerFactory licenses.
• a queue function used to collect scenarios to be processed
in a managed way by the “PowerFactoryComponent” in a
3 MAY 2023
launched container.
Idea – concept Image registry
Windows server

Image
Settings PowerFactoryComponent
Python application

✓ IGM
❑ Security analysis

Pull image Output


PowerFactoryOrchestrator
Fetch input data & launch IGM
containers to produce the
desired output Container orchestration system

Container Output
Launch
IGM
containers
Container

Output
Container
IGM

3 MAY 2023
Idea – Concept Image registry
Windows server

Image
Settings PowerFactoryComponent
Python application

❑ IGM
✓ Security analysis

PowerFactoryOrchestrator
Fetch input data & launch
containers to produce the
desired output Container orchestration system

3 MAY 2023
PoC – Vision

In early 2023 Energinet, Microsoft Denmark & Fellowmind Denmark agreed to initiate a Proof-of-
Concept (PoC) – with support from DIgSILENT – in order to validate this hypothesis:

“It is possible to use PowerFactory for Individual Grid Model (IGM) generation, and to perform
Security Analysis, in a containerized cloud environment – Docker images in a Microsoft Azure
Kubernetes Service (AKS) setup – based om Common Grid Model Exchange Standard (CGMES) &
Common Information Model (CIM) data exchanges”

3 MAY 2023
PoC – Scope

• IGM creation
• Perform multiple parallel IGM creation processes according to CGMES 2.4.15 format
• Steady state Security Analysis
• Perform multiple parallel Steady state Security Analysis processes based on CGMES 2.4.15 models
• Scalability test
• Will the setup be able to scale up & down according to the demand?
• Performance tests
• Try to identify the optimal parallel processes for both IGM creation & Security Analysis (Limit: Available PowerFactory
licenses)
• Eg. price indications/estimates
• Present different price structures for different scenarios (consider redundancy)

3 MAY 2023
PoC – Expected benefits

• Improved test, deployment & IT-operation processes


By utilizing Docker container technologies, with clearly defined and standardized interfaces as well as standard software, it is expected that Energinet will be able to encapsulate needed
software functionality in fully testable Docker images. Furthermore, this will also ease the software deployment process and the IT-operation itself.

• No compute hardware constraints


By utilizing modern containerized fast scalable cloud technologies, it is expected that Energinet will be able to perform as many security analysis’ as any given operating situation requires, and
not limit the amount of analysis’ due to physical compute hardware constraints.

• Easy scaling
By utilizing Azure Kubernetes Service, it is possible to start as many parallel processes as needed, with containers all based on the same image, and only pay for the compute power when it is
used.

• Fast rollback
In case containers, based on new Docker images, starts to malfunction or fail – due to issues not covered in the test phase – it is easy to rollback to a previous version of the Docker images
when launching new containers.

• Always a new & “fresh” server


When a new image is built, it’ll be with the newest Windows server version – if chosen
When a new node (VM) is spawned up, it’ll be with the newest OS version – if chosen

3 MAY 2023
Azure Kubernetes Service (AKS) manages your hosted Kubernetes
environment and makes it simple to deploy and manage containerized
applications in Azure. Your AKS environment is enabled with features
PoC – Setup such as automated updates, self-healing, and easy scaling.

3 MAY 2023
PoC – Setup

Output
Input

Output

Processes will start → log files

Event: a new txt-file


Processes will stop → status file
3 MAY 2023
Demonstration

• IGM creation

• Steady state Security Analysis

3 MAY 2023
Price indications

Realized AKS cluster


• AKS
o 1 cluster of 70 EUR/month
• System pool
o 3 nodes of 180 EUR/month ~ 540 EUR/month
▪ Azure VM Comparison (azureprice.net) (D2_v2)
• User pool
o 12 nodes of 1,4 EUR/hour ~ 17 EUR/hour
▪ Azure VM Comparison (azureprice.net) (F16s_v2)

3 MAY 2023
Time consumption for parallel tasks with different VMs

• VM sizes - Azure Virtual Machines | Microsoft Learn


• Fsv2-series - Azure Virtual Machines | Microsoft Learn

3 MAY 2023
Time consumption for parallel tasks with different VMs

3 MAY 2023
Sub process measurements (F16s_v2)

PowerFactoryComponent - performCgmesExport: - performCgmesExport: - performCgmesExport: - performCgmesExport: - performCgmesExport:


True True True False False
- performContingencyAnalysis: - performContingencyAnalysis: - performContingencyAnalysis: - performContingencyAnalysis: - performContingencyAnalysis:
True True False True True
- exportSecurityAnalysisResult: - exportSecurityAnalysisResult: - exportSecurityAnalysisResult: - exportSecurityAnalysisResult: - exportSecurityAnalysisResult:
False False False False False
- exportPowerFactoryProject: - exportPowerFactoryProject: - exportPowerFactoryProject: - exportPowerFactoryProject: - exportPowerFactoryProject:
True False False True False Average
Start 13:05:55 13:37:31 13:41:41 13:45:26 13:50:01
PowerFactory started & CGMES profiles are loaded 13:06:43 00:00:48 13:38:19 00:00:48 13:42:29 00:00:48 13:46:18 00:00:52 13:50:54 00:00:53 00:00:50
CGMES export done 13:07:37 00:00:54 13:39:14 00:00:55 13:43:24 00:00:55 - - 00:00:55
Contingency analysis done 13:08:10 00:00:33 13:39:46 00:00:32 - 13:46:46 00:00:28 13:51:21 00:00:27 00:00:30
PowerFactory project exported as PFD 13:08:43 00:00:33 - - 13:47:09 00:00:23 - 00:00:28
Process finalized 13:08:43 13:39:46 13:43:27 13:47:09 13:51:21
00:02:48 00:02:15 00:01:46 00:01:43 00:01:20 0:02:42
PowerFactoryOrchestrator 00:03:04 00:02:32 00:02:00 00:01:59 00:01:35
00:00:16 00:00:17 00:00:14 00:00:16 00:00:15 00:00:16

Tested: 20.04.2023 Input: P:\CGMES\Import\20230419T0730Z_00_ENDK-IGM_SV_000.zip


Sub process measurements (F16s_v2)

00:00:00 28 s. 00:02:42
50 s. 55 s. 30 s.
t
Sub process measurements (F16s_v2)

00:00:00 28 s. 00:02:42
50 s. 55 s. 30 s.
t
Questions?

3 MAY 2023
Bonus info

3 MAY 2023
Intro to Azure Kubernetes Service - references

Docker
• Introduction to Docker containers - Training | Microsoft Learn
• Docker overview | Docker Documentation

Kubernetes
• Introduction to Kubernetes - Training | Microsoft Learn
• Concepts | Kubernetes

AKS
• Introduction to Azure Kubernetes Service - Training | Microsoft Learn

3 MAY 2023
Intro to Azure Kubernetes Service - Docker

What is Docker?
Docker is a containerization platform used to develop, ship, and run containers. Docker doesn't use a hypervisor, and you can run Docker on
your desktop or laptop if you're developing and testing applications. The desktop version of Docker supports Linux, Windows, and macOS.
For production systems, Docker is available for server environments, including many variants of Linux and Microsoft Windows Server 2016
and above. Many clouds, including Azure, support Docker.

What is an image?
An image is a read-only template with instructions for creating a Docker container. Often, an image is based on another image, with some
additional customization.
To build your own image, you create a Dockerfile with a simple syntax for defining the steps needed to create the image and run it.
The container image becomes the unit we use to distribute our applications.

What is a container?
A container is a runnable instance of an image. You can create, start, stop, move, or delete a container using the Docker API or CLI. You can
connect a container to one or more networks, attach storage to it, or even create a new image based on its current state.

3 MAY 2023
Intro to Azure Kubernetes Service - Docker

What can I use Docker for?


Docker streamlines the development lifecycle by allowing developers to work in standardized environments using local containers which
provide your applications and services. Containers are great for continuous integration and continuous delivery (CI/CD) workflows.
Consider the following example scenario:
• Your developers write code locally and share their work with their colleagues using Docker containers.
• They use Docker to push their applications into a test environment and execute automated and manual tests.
• When developers find bugs, they can fix them in the development environment and redeploy them to the test environment for testing and
validation.
• When testing is complete, getting the fix to the customer is as simple as pushing the updated image to the production environment.

3 MAY 2023
Intro to Azure Kubernetes Service - Docker

Docker architecture

Docker Desktop is an easy-to-install application for your Mac, Windows or Linux environment that enables
you to build and share containerized applications and microservices. Docker Desktop includes the Docker
daemon (dockerd), the Docker client (docker), Docker Compose, Docker Content Trust, Kubernetes, and
Credential Helper.
3 MAY 2023
Intro to Azure Kubernetes Service - Kubernetes

What is Kubernetes?
• Kubernetes is a portable, extensible, open source platform for managing containerized workloads and services, that facilitates both
declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely
available.

What is Pod?
• Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.
• A Pod (as in a pod of whales or pea pod) is a group of one or more containers, with shared storage and network resources, and a
specification for how to run the containers. A Pod's contents are always co-located and co-scheduled, and run in a shared context. A Pod
models an application-specific "logical host": it contains one or more application containers which are relatively tightly coupled. In non-
cloud contexts, applications executed on the same physical or virtual machine are analogous to cloud applications executed on the same
logical host.

3 MAY 2023
Intro to Azure Kubernetes Service - Kubernetes

Kubernetes architecture

3 MAY 2023
Intro to Azure Kubernetes Service - AKS

What is Azure Kubernetes Service (AKS)?


• Azure Kubernetes Service (AKS) manages your hosted Kubernetes environment and makes it simple to deploy and manage containerized
applications in Azure. Your AKS environment is enabled with features such as automated updates, self-healing, and easy scaling. The
Kubernetes cluster master is managed by Azure and is free. You manage the agent nodes in the cluster and only pay for the VMs on which
your nodes run.
• You can either create your cluster in the Azure portal or use the Azure CLI. When you create the cluster, you can use Resource Manager
templates to automate cluster creation. With these templates, you specify features such as advanced networking, Azure Active Directory
(AD) integration, and monitoring. This information is then used to automate the cluster deployment on your behalf.
• With AKS, we get the benefits of open-source Kubernetes without the complexity or operational overhead compared to running our own
custom Kubernetes cluster.

Node pools
• In Azure Kubernetes Service (AKS), nodes of the same configuration are grouped together into node pools. Node pools contain the
underlying VMs that run your applications. System node pools and user node pools are two different node pool modes for your AKS
clusters. System node pools serve the primary purpose of hosting critical system pods such as CoreDNS and metrics-server. User node
pools serve the primary purpose of hosting your application pods. However, application pods can be scheduled on system node pools if
you wish to only have one pool in your AKS cluster. Every AKS cluster must contain at least one system node pool with at least one node.

3 MAY 2023

You might also like