Enterprise Cloud Control Script

This guide is relevant only for Photon Enterprise Cloud customers.

Content

Concept

Enterprise customers can restart Master or Game Servers on clusters of their private Photon Cloud. This can be done using a PowerShell script that is given to customers on request.

Required Customer Data

The customer's credentials ("CustomerName" and "Key") are required for the script to work. Also cluster names may be needed.

To better illustrate the restart process, we will use the following example values:

  • Customer: "SampleCustomer"
  • Key: "MyKey"
  • Cluster: "MyCluster"

Preparing PowerShell

The minimal required PowerShell version is 3.0 (Windows Management Framework 3).
  1. Download the cloud control client zip file. Unblock the "Photon.PrivateCloud.Plugin.Control.Client.zip" file and then extract its content. For more information on how to unblock a file, please visit this link.
  2. Please make sure to synchronize date and time on the machine running the cloud control script. Otherwise, it might not work. For more information regarding this please visit this link.
  3. Open a new PowerShell window. It is recommended to start a new PowerShell session for the cloud control.
  4. If you have the default Windows PowerShell "Restricted" execution policy you need to change it. We recommend to set it to "RemoteSigned" using Set-ExecutionPolicy RemoteSigned. To get the current execution policy use Get-ExecutionPolicy. Read more about "Running Scripts" from Microsoft TechNet.
  5. Import the modules needed from the script "Photon.PrivateCloud.Plugin.Control.Client.psm1" as follows:

    
    Import-Module .\Photon.PrivateCloud.Plugin.Control.Client.psm1
    
    
  6. The available commands imported in the module can be listed using:

    
    Get-Module Photon.PrivateCloud.Plugin.Control.Client | Select-Object -ExpandProperty ExportedCommands
    
    
  7. To get help about a command just use Get-Help with the command name available from the previous list.

    Example to get help about Restart-PhotonCloud:

    
    Get-Help Restart-PhotonCloud -Detailed
    
    

Restart

Use the "Restart-PhotonCloud" command to restart Photon Master or Game Servers on one or all clusters.

All Clusters

By default, a restart happens on all Game Servers if nothing is explicitly specified. You can also explicitly specify what servers to restart Master or GameServer.

Restart Game Servers On All Clusters

To restart Game Server(s) on all clusters you can do this in three ways:


Restart-PhotonCloud -Customer SampleCustomer -Key MyKey


Restart-PhotonCloud -Customer SampleCustomer -Key MyKey -ServerType GameServer


Restart-PhotonCloud -Customer SampleCustomer -Key MyKey -GameServer

Restart Master Servers On All Clusters

To restart Master Server(s) you can do this in two ways:


Restart-PhotonCloud -Customer SampleCustomer -Key MyKey -ServerType Master


Restart-PhotonCloud -Customer SampleCustomer -Key MyKey -Master

Specific Cluster

If you have more than one cluster and want to restart servers only on a specific one you can do so by specifiying its name.

Restart Game Server(s) On A Specific Cluster

To restart Game Server(s) on a specific cluster (e.g. "MyCluster") you can use one of the following commands:


Restart-PhotonCloud -Customer SampleCustomer -Key MyKey -Cluster MyCluster


Restart-PhotonCloud -Customer SampleCustomer -Key MyKey -ServerType GameServer -Cluster MyCluster


Restart-PhotonCloud -Customer SampleCustomer -Key MyKey -GameServer -Cluster MyCluster

Restart Master Server(s) On A Specific Cluster

To restart Master Server(s) on a specific cluster (e.g. "MyCluster") you can use one of the following commands:


Restart-PhotonCloud -Customer SampleCustomer -Key MyKey -ServerType Master -Cluster MyCluster


Restart-PhotonCloud -Customer SampleCustomer -Key MyKey -Master -Cluster MyCluster

Verify

To check the status of servers restart you can use "Get-PhotonCloudRestartStatus" cmdlet:


Get-PhotonCloudRestartStatus -Customer SampleCustomer -Key MyKey

 To Document Top