Search code examples
customizationactorazure-service-fabric

Can I customize azure service fabric vm nodes?


I would like to leverage reliable actor model in the azure service fabric. Our actor model computation requires specific software installed on the vm node. Can I have custom software installed (on top of the azure service fabric software) in the vm nodes so that I can leverage this software in the actor model computation? As part of the my actor model deployment into azure service fabric, can I author this custom software installation into it? Is this how it should be done? Or are there any other ways? Or is it even possible?

Raghu/..


Solution

  • You have multiple options:

    Install the software manually on each server

    If you don't change the number of servers often and if you don't have a lot of servers, you could just RDP into each server and manually install your software.

    Run it as a separate service in Service Fabric

    As JunRam said, you can run guest executables in Service Fabric. Assuming your software is a simple program without an installer, you could create a stateless service package for it and set the InstanceCount to -1. This means, the service will be placed on every node by Service Fabric. Service Fabric will then automatically re-start the program if it terminates unexpectedly and it will also place it on new nodes when you scale out.

    Use Virtual Machine Extensions

    Some software can be integrated directly into the ARM (Azure Resource Manager) template of your virtual machine. The default ARM template of Azure Service Fabric uses this mechanism to automatically install the "Azure Diagnostics" agent and the Service Fabric agent on each server. To get an ARM template for Service Fabric, you can either use a quickstart sample, use the Azure Portal wizard and export it right before you would create the cluster or export an existing resource group as a template.

    There's also a Custom Script Extension that allows you to run a CMD or PowerShell script. Within such a script you could e.g. use Chocolatey, Boxstarter or manually install your program.

    The advantage of this method is that it installs the software as part of your infrastructure deployment and it also automatically installs the software on each new node when you scale out your cluster.

    Use an automation tool like PowerShell DSC, Puppet, Chef

    If the program you want to install is not available directly as a Virtual Machine Extension and can not be installed with a "Custom Script Extension", you could use Azure Automation DSC (Desired State Configuration) to automate the installation of additional software on your nodes. DSC needs an agent on your virtual machines, which is available as a Virtual Machine Extension. There is an ARM-based template that shows how you can integrate the extension into a Virtual Machine Scale Set. You can include this extension in your Service Fabric ARM template and re-deploy it to have the extension installed on each of your nodes.

    After this, you could use the Package feature of DSC to install your software.

    Be aware that creating this solution might require a considerable amount of time. However, PowerShell DSC is a very powerful system that, once installed, gives you many more possibilities in terms of server management.

    Use your own VM image

    You can capture and upload a virtual machine image and use this as the base image for your Service Fabric ARM template. This might be useful if you need to execute steps on your server which can't be automated easily.