First published on MSDN on Jan 11, 2019
Welcome to the first post of 2019! This post was authored by Suneet Nangia (Microsoft) working with Mark Fussell (Service Fabric team).
As a part of on OpenHack event in London recently, I had a chance to run a Minecraft server on
Service Fabric Mesh
. In this blog I will go through the aspects of configuring and running Minecraft on Mesh and then showing an upgrade where the state of the game is maintained using a Service Fabric Reliable Disk volume . You will need to buy (or have already) a copy of the Minecraft client in order to play which is available here
Mesh is in public preview and features are still in beta/development stages, nevertheless the example demonstrates the value proposition of Mesh. The Minecraft server is available as a container for both Windows and Linux platforms. We will use the container available for a more recent version of Windows, 1803 on the Docker Hub Openhack repo here
In order to run the Minecraft container image, you need to set up the following;
Port 25565 is required to allow clients to connect and play.
Port 25575 is a RCON port required to manage the server remotely.
Running Minecraft server needs EULA to be accepted.
The game server container needs at least 2 cores to run correctly.
Here’s what the overall flow looks like from development, to deployment and then playing.
In Mesh, all application related resources are first class ARM resources of ServiceFabricMesh resource type i.e. they are part of Mesh resource provider including Networks and Storage. The ARM template for the Minecraft app design is shown below.
Here you will see that I have created a ServceFabricMesh/gateways for the ingress ports both opened as TCP. By mounting a
Service Fabric Reliable Disk volume
to c:\data folder allows, Minecraft container to save the game progress/world to persistent storage. As a resultif the container host VM machine is failed over or the container is restarted (due to an upgrade for example), you do not lose the game data.
The complete ARM template is available
on a GitHub gist which you can download and run in your Azure subscription.
Deploying the Minecraft application
Mesh is currently free and available in US West, US East, and Europe West regions during a
Enter the public IP address of the Mesh application (see screen shot below)
Enjoy crafting on Service Fabric Mesh!
Upgrading the Minecraft application and maintaining game state
Let’s now upgrade the MinecraftServerSvc service by updating the value for the memory allocated, perform an upgrade which will restart the container, and then reattached the client to see how the game state has been preserved.
First play Minecraft and change something in the game.
Download the ARM template to your local machine and open this in a text editor. Save the file as “MinecraftOnMesh.json” and update the memoryInGB from the value “2” to “2.5” like this.
Now update the current Mesh application deployment using this local ARM file (provide a suitable path) using the following CLI command
You can watch the upgrade either with the “az mesh deployment show” command or by watching the activity in the Azure portal.
The screen shots below show the upgrade activities and the final completed deployment in the portal
Now reconnect the Minecraft client to the Minecraft server (it will have the same IP address) and see that your game state is the same despite the service being upgraded to have more memory.