So I had this little problem at home. my son bugging me every second day to create a new minecraft server. So the answer to this problem is minecraft as a service.
But how to do it? There is many ways I could of achieved this, but with the buzz around containers and cloud native apps I thought let change it up and mix in some container action. This will be a pretty light weight post on details compared to my usual posts. I thought some of the vRA (vCAC) extensibility should and will get its own post, to look at it in more detail.
I’m going to use vRA formally known as vCAC to deploy this MaaS.
1) First things first lets download a Linux distro, I use both VMware’s own Photon but also had CentOS 7 already in my lab.
2) Configure a Linux template with the vCAC agent, Here is a good reference on a step by step how too.
3) With photon docker is pre-installed but with CentOS pre-install docker with
yum install docker
4) Enable docker to start on boot with
systemctl enable docker
5) When you got really poor internet like me Its best to host your own docker repository so deployments like this don’t take until Christmas. follow the instruction on the docker website HERE to setup a local repo.
6)Before creating the template after installing docker edit the docker file at /etc/sysconfig/docker. and add the following line.
Yes this is not the most secure way to do it but its quick and I dont think my son will be hacking me anytime soon 🙂
7) Create a vRA blueprint to clone from the image created
8) Time to create or download a minecraft container. There is a number of pre built minecraft containers on the docker hub here The itzg one looked popular so lets choose that one.
9)Now we pull this down and push it up into the new local repo. using the following
docker pull itzg/minecraft-server && docker tag itzg/minecraft-server <ip/fqdn:5000>/path
in my case
docker pull itzg/minecraft-server && docker tag itzg/minecraft-server 10.0.0.239:5000/virtualiseme/minecraft
Then push to the repo with
docker push 10.0.0.239:5000/virtualiseme/micecraft
So now we have the repo to use time to actually use it. What I will do here is a very simple run script in guest using vRO provisioning stub.
11) attach this workflow to the machine provisioned stub by using the workflow “Assign a state change workflow to a blueprint and its virtual machines” under vCAC extensibility.
Now we have a simple MaaS deployment my son can deploy with his friends 🙂