Creating a Cloud Environment

To use the Genvid SDK with your game, you need to have a cloud environment to run your Genvid Cluster services on. We begin by setting up your Azure account and taking you through all the steps required to prepare your new environment for use.

Important

The Genvid SDK includes the necessary Terraform templates for managing your cluster on Microsoft Azure and Amazon Web Services (AWS). If you’re planning to use another cloud service-provider (Google Cloud, etc.), please contact us directly for the help with setting it up.

The first time you configure a cluster, it usually takes about an hour. After you create a cluster, you can share it with other users on your team.

Before You Begin

Note

If you want to use Azure as your cloud service, you need to have Python 3.8.x installed so you can run the Genvid Toolbox using that version.

To verify your Python version, use the following command:

py -3 --version

For running on Azure, you first need a Microsoft account with access to Azure activated. Please note that Genvid Technologies is not responsible for any billing on your account.

See the Azure portal for more information on setting up an account.

Sign In to Azure

Once you’ve created your Azure account, configure the Azure command-line interface (CLI) on your local machine. The command below opens a browser page where you can authenticate yourself to allow the CLI to operate on Azure resources.

az login

See Get started with Azure CLI on the Azure website for more information.

Create Images

To avoid uploading large images each time you want to create a new cluster, you need first to create base images in your subscription. Once created, your Terraform modules can use them to build new Azure clusters.

Important

You have to create a new image whenever you upgrade the version of the Genvid SDK you’re working with.

Warning

We disable Windows Defender, Windows Defender SmartScreen, and Windows Firewall in the AMI for performance reasons.

Note

You need to set up your bastion on Azure before creating your images. See Set Up a Bastion Server for more information.

Once you’ve set up your bastion, you can create your images.

  1. Sign in to your Azure subscription.

  2. From the CLI, run:

    genvid-azure-image create-images

Creating images takes between 30 minutes to 1 hour. When finished, there will be a resource group (Genvid) containing a shared gallery (SDKgallery). The shared gallery will contain two images:

  • One for Linux, found in the genvidtech-server image definition resource.

  • One for Windows, named genvidtech-wingame.

Both will be have the version of the SDK currently used.

The create-images command has optional arguments you can use to override the default values used to allocate resources on Azure. If you use them, you will need to override them in the following commands.

You may also find it convenient to register values set using optional arguments globally in the bastion Terraform settings so they can be used when creating other Azure clusters. You don’t need to specify them for every cluster you create.

To register your custom values globally:

  1. Open the Bastion UI.

  2. Click Settings.

  3. Click Global Vars.

  4. Add the values from genvid-azure-image create-images to:

    • shared_gallery_resource_group_name,
    • shared_gallery_image_version, and
    • shared_gallery_name.

    For example: If the resource group created is genvidtest, add shared_gallery_resource_group_name:genvidtest

Once you add your values, any new cluster you create will use the images you just created.

Start Game Instance to Complete Configuration

The game instance will need the necessary drivers and configuration to run games. This section describes how to spin up an instance for the purpose of configuring it for later use. Later you will create an image from this instance for use in your Azure clusters.

  1. Create and start the game instance.

    genvid-azure-image setup {CLUSTER_ID}

    Replace {CLUSTER_ID} with a value of not more than 8 characters. This is due to the standard Genvid SDK naming scheme and an 8-character limit for instances on Azure servers.

    This will start a cluster in your bastion named CLUSTER_ID with the suffix img. The output of the command will indicate the public IP of the instance.

    Important

    The location must be the same as the one used to import the images with the create-images command. Otherwise, Terraform will not be able to find the base image.

    The Azure resource group and shared gallery name must also be properly identified if not using the default values. Use the additional command arguments to do so.

    The command makes use of Terraform and Bastion to start the game instance. By default the instance type used is Standard_NV6. This type is not available for all subscription and locations. This will be reflected with the command failing with the error message:

    The requested size for resource 'XXXX-game-1' is currently not available in location 'XXXX'
    

    If this is the case, another instance type must be used. We have seen that in some cases the promo version of Standard_NV6 can be used: Standard_NV6_Promo. We can instruct the setup command to use this type by creating a file containing:

    instance_game_type = "Standard_NV6_Promo"
    

    If the file is saved with the name setup.tfvars in the current folder, we can have the tool use it like this:

    genvid-azure-image setup {CLUSTER_ID} --tfvars setup.tfvars
    

    If the Standard_NV6_Promo type does not exist in your account and location, try to find another NV instance type or one that supports NVidia graphics drivers.

    All the resources created with this command will be located in a new Azure resource group using CLUSTER_ID and the suffix img-setup.

  2. Use a virtual network computing (VNC) client to connect to the instance using the IP from the output of the genvid-azure-image setup command using port 5900. The default password is 1genvid6.

    See Connecting to the Game Machine the First Time for instructions on navigating the various dialogs you see the first time you connect to the instance.

  3. Now you can set up your game machine on Azure.

Create Image from Configured Instance

Now that you have a fully-configured Windows game instance, you can create an image from it.

genvid-azure-image save {CLUSTER_ID}

Use the same CLUSTER_ID used when you set up the cluster.

This creates another cluster in your bastion named CLUSTER_ID, but with the suffix imgsave.

Once the image is created, it should show up in the same resource group and shared image gallery as the other images under the image definition name default-wingame.

Clean the Setup Clusters

At this point you need to remove the 2 clusters from your bastion created in the previous steps and delete the resources that are no longer necessary.

genvid-azure-image clean CLUSTER_ID

Use the same CLUSTER_ID as before.