Linux

Microsoft Hearts Linux. No, really, we do!

When I used to think about Linux from my bias as a Windows developer I used to think about posts like this (courtesy PennyArcade):

Yes, all the way back in the dusts of time – say 2002. Well, things have changed a lot since then. We have all kinds of great Linux integration points. And I must say – from my experiments and fumbling around with Linux – I remain very impressed with it as an ecosystem. I can’t think of a better central point when it comes to running lean, mean DevOps – Chef and Puppet run natively on it and setup couldn’t be easier. And I love the control. All that CLI goodness just takes me back to my first days writing programs on my old C64.

My good friends Jeremy Rule and Rich Maines wrote recently on Microsoft embracing Linux: “Did you know that 20% of virtual machines on Azure are Linux today? Azure also provides first-class support for Java, Node.js, Python, Ruby, and PHP and our recently announced Azure cloud security tools will work both on premise and in Amazon’s cloud.”

I know personally I’ve had to step up my game in terms of embracing Linux as an OS – including the LAMP stack (Linux-Apache-MySQL-PhP) – and Java. We can’t afford to be insular and think that MSFT provides the best in class tool for every given scenario. And on the Linux side of things, combining your development with the VS IDE means you’ll have enterprise-level debugging and repeatability that your team has been craving. Wow!

Anyway as I’ve left behind my prejudices and misconceptions about what Linux and OS programming is like, I’ve become a better programmer and a much better architect. I’m glad the old adversarial ways have passed behind; cooperation and integration is the new game and it frees up a lot of limitations that used to hurt our customers. Nicely done guys!

Other Points

  • A great article on 31 points successful people have used to form positive life habits. Three that popped out – get enough sleep (no screen time 1 hr before bed), waking up early and working out is nonnegotiable, and eating the frog (putting the most important things first).
  • A great comic on the long road to confronting climate change, highly recommended.
Advertisements

Walkthrough – Creating a Linux VM in Azure

I saw this great post recently by Donovan Brown. Thought I would take a waltz thru it really quick and share.

Creating a Linux Based Development Box on Azure

It might be a good idea to first create an availability group – add a Storage and a Cloud Service with a good naming convention you like. This way it won’t arbitrarily assign some wacked out names for you and you can delete them later.

  1. Open up the Azure Management Portal – the Plus sign on the lower left (Add) -> select Compute -> Virtual Machine -> From Gallery.


  2. Look at all these Ubuntu images we can pick from. Select Ubuntu, open up port 3389 for RDP.


     

  3. Select A2 for the sizing. I unselected the SSH option and picked out a good strong admin password.


  4. Pick a good region and your (previously selected) storage accounts. Very important here – open up a port for RDP for 3389. (If you forget, you can also do this later in the Endpoints section of the Azure dashboard.)


  1. This next portion will take a while. Open up your SSH client of choice – some people like Putty, I like Bitvise. Then enter in the following into command line:
  • sudo apt-get update
  • sudo apt-get install xrdp
  • sudo apt-get install xfce4
  • sudo service xrdp start
  • sudo apt-get install eclipse
  • sudo apt-get install libwebkitgtk-1.0-0
  • sudo apt-get install firefox

OK, that’s done. It takes, well, about forever. Once that’s done though you’re about there.

  1. Use remote desktop to dial onto ____.cloudapp.azure.com.
  2. R-click on the Panel – Add New Items, select Launcher. R-click, Properties, and add Eclipse. This will drop an icon onto the bottom part of your window.
  3. Click on the Earth to open up fireFox.
  4. Start up Eclipse and select the Help menu. select Install New Software…
    1. Click Add… enter “TFS Plugin for Eclipse” for the name, and location of http://dl.microsoft.com/eclipse/tfs

  5. Select Team Explorer Everywhere. Click Next > , and then Next>
  6. Accept the Microsoft Software License Terms
    1. Click Finish
  7. Restart Eclipse when prompted
  8. Close the Welcome page
  9. Select Window / Open Perspective / Other…
  10. Select Team Foundation Server Exploring
  11. Click OK
  12. Click Connect to Team Foundation Server and follow the instructions to connect.

And that’s it. You’ve got a fully running developer VM running Ubuntu, Eclipse and plugged into TFS – all on Linux.

 

Some DevOps Links for Today

Just set up a HA linux cluster… like a BOSS! (JBoss, that is…)

Followed the incredibly easy startup guide from Keith Mayer, superstar – http://blogs.technet.com/b/keithmayer/archive/2014/10/03/quick-start-guide-building-highly-available-linux-servers-in-the-cloud-on-microsoft-azure.aspx

The Powerpoint deck is about 20 slides or so, incredibly easy to follow. But here’s a Cliff notes version for us Linux newbies out there:

  1. Log onto the Azure management portal. https://manage.windowsazure.com/ – the new one is fine.
  2. Create an Affinity Group (Settings -> Affinity Group). Call it something like LinuxForDemoDH or the like.
  3. Create a Storage Account. Click + (New), Create a Storage Account, then Data Services -> Storage -> Quick Create. Select your Affinity Group.
  4. Create a Virtual Network. (Network Services -> Virtual Network, Quick Create).
  5. Create a Cloud Service. (Compute, Cloud Service, Quick Create). Select your affinity group! I called this “linuxwebapp” in my example.
  6. Add a new VM from the Gallery.
    1. In this case I chose Ubuntu, Ubuntu Server 14.04 LTS.
    2. Called it “linuxwebapp01” but it really doesn’t matter since the frontend is set in #5 above.
    3. Uncheck the SSH key, and check Provide a password.
    4. Select your Cloud Service and your Virtual Network / Storage Account.
    5. Select the option to Create an Availability Set (call it Linuxwebapp or the like)
  7. Follow the above steps to add a second VM. Call it lxwebapp02 or the like. Only you won’t need 6e, just point to what you created then.
  8. Select your App01 VM and browse to the dashboard, then point to Endpoints and select + Add.
    1. Add a standalone Endpoint
    2. Call it HTTP – and select TCP | 80 |80.
    3. Select the option to create a load balanced set. Call it LB_HTTP.
  9. Follow the steps above for WebApp02, only hook up to an existing LB set.
  10. Look at the dashboard and note the name/port of the environment under the SSH DETAILS portion. Connect to it using a SSH client like bitvise, and use the azureuser account you specified last time. A Linux shell prompt will open. Enter the following: run sudo apt-get install apache2
  11. Follow the same steps on the second webserver.
  12. Now to test. Open up the App01 web server in Azure management portal and select the Dashboard, then look at the DNS name. Try to open it in a new browser window. If you can view the following, you’re golden!

That’s it for now. I’m going to try more automatic provisioning of my new highly available and scalable Linux webservers later today.

<news flash>Well I just got brought in on another firefighting task so my IAC (Infrastructure As Code) efforts will have to wait. See this post for the script I was going to follow: http://blogs.technet.com/b/keithmayer/archive/2014/12/01/step-by-step-automated-provisioning-for-linux-in-the-cloud-with-microsoft-azure-xplat-cli-json-and-node-js-part-2.aspx