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. Once a cluster is created, you can share it with other users on your team.
In This Section
Before You Begin¶
Note
If you want to use the Azure, you will need to have Python 3.8.x installed with the Genvid Toolbox installed in it Install the Toolbox. To verify your Python version, use the following command:
py -3 --version
For running on Azure, you first need an 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 will open a browser page where you will be able to 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.
If you have not yet installed bastion, please do so following the instructions Set Up a Bastion Server. Once bastion has been installed, you can proceed with image creation described in the section below.
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, they can be be used by the Terraform modules 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.
Sign in to your Azure subscription.
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 and one for Windows. The linux one will be in the genvidtech-server image definition resource and the Windows one will be in the one named genvidtech-wingame. Both will be have the version of the SDK currently used.
The create-images command has optional arguments that can be used to override the default values used to allocate resources on Azure. If some are used, they will need to be overridden in the following commands as well. Also, it is convenient to register them globally in the Bastion Terraform settings so that they can be used when creating Azure clusters. You will not need to specify them for every cluster you create.
To do so:
Open the Bastion UI.
Click Settings.
Click Global Vars.
Add shared_gallery_resource_group_name, shared_gallery_image_version and shared_gallery_name with values provided by genvid-azure-image create-images.
For example: If the resource group created is
genvidtest
, addshared_gallery_resource_group_name
:genvidtest
Once your values are added there, any new cluster that you create will use the images you just created.
Start Game VM to Complete Configuration¶
The game VM will need the necessary drivers and configuration to run games. This section will describe how to spin up a VM for the purpose of configuring it for later use. Later an image will be created from this VM for use in your Azure clusters.
Create and start the game VM with the command below. Replace
CLUSTER_ID
with a value of your choice. Because of limitations of 15 characters for the virtual machine names on Azure and our naming scheme, theCLUSTER_ID
maximum length is 5.genvid-azure-image setup CLUSTER_ID
This will start a cluster in Bastion named
CLUSTER_ID
appended withimg
. The output of the command will indicate the public IP of the VM.Note that the location must be the same as the one used to import the images with the
create-images
command executed earlier. 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. This can be done using additional arguments with the command.All the resources created with this command will be located in a new Azure resource group named after the
CLUSTER_ID
supplied with the suffiximg-setup
.Use a VNC client to connect to the VM using the recovered IP and the port 5900. The password is
1genvid6
.Once connected, follow the instructions at Connecting to the Game Machine the First Time.
Then follow the instructions at Configure the Windows Instance.
Create image from configured VM¶
Now that we have a fully configured Windows game VM, we must create an image from it using the command below.
Use the same CLUSTER_ID used at the previous step:
genvid-azure-image save CLUSTER_ID
This will create yet another cluster in Bastion named CLUSTER_ID 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 we need to remove the 2 clusters created in the previous steps from Bastion and delete the resources that are no longer necessary. This is done with the following command:
genvid-azure-image clean CLUSTER_ID
Again, use the same CLUSTER_ID as before.
Additional references for Azure¶
Reference for tool genvid-azure-image