//Cloud notes from my desk -Maheshk

"Fortunate are those who take the first steps.” ― Paulo Coelho

Failed to delete virtual network ‘k8s-vkdemo-2-vnet’. Error: Subnet virtual-node-aci is in use by and cannot be deleted

Recently I tried deleting few resource groups(RG) having AKS cluster with ACI enabled. I couldn’t get them deleted completely for some reason leaving Vnet all those RG’s.

Error message was “Failed to delete virtual network ‘k8s-vkdemo-2-vnet’. Error: Subnet virtual-node-aci is in use by and cannot be deleted.” I got the same error for other 2 cluster RG as well. I tried deleting individual sub-nets there I got an error.

With help of support and this article I was able to delete the RG. It’s is documented here -> https://docs.microsoft.com/en-us/azure/container-instances/container-instances-vnet#delete-network-resources.

Here is the revised script.

# Replace <my-resource-group> with the name of your resource group
RES_GROUP=<my-resource-group>

# Replace <my_vnet_name> with the name of your VNet name
VNET_NAME=<my_vnet_name>

# Replace <my_subnet_name> with the name of your subnet name
SUBNET_NAME=<my_subnet_name>

# Get network profile ID
NETWORK_PROFILE_ID=$(az network profile list --resource-group $RES_GROUP --query [0].id --output tsv)

# Delete the network profile
az network profile delete --id $NETWORK_PROFILE_ID -y

# Get the service association link (SAL) ID
SAL_ID=$(az network vnet subnet show --resource-group $RES_GROUP --vnet-name $VNET_NAME --name $SUBNET_NAME --query id --output tsv)/providers/Microsoft.ContainerInstance/serviceAssociationLinks/default

# Delete the default SAL ID for the subnet
az resource delete --ids $SAL_ID --api-version 2018-07-01

# Delete the subnet delegation to Azure Container Instances
az network vnet subnet update --resource-group $RES_GROUP --vnet-name $VNET_NAME --name $SUBNET_NAME--remove delegations 0

# Delete the subnet
az network vnet subnet delete --resource-group $RES_GROUP --vnet-name $VNET_NAME --name $SUBNET_NAME

# Delete virtual network
az network vnet delete --resource-group $RES_GROUP --name $VNET_NAME

2019-03-18 Posted by | AKS, Azure, Azure Dev, Uncategorized | Leave a comment

AI Revolution and resources

Before 1990, its was all CLI. Every software had commands & parameters. That was the standard of the Software development. Post that we had GUI based interfaces having buttons and mouse clicks. Around 1995, we had Internet Web UI as became the standard. After the success of smart phones in 2008, we saw more Responsive UI developed using jQuery,Bootstrap and now we live in the era of Conversation UI. Bots like Cortana, Siri, Alexa are around the block to help our modern needs.

Below is the snippet which I borrowed from this ebook covering “how the enterprise information technology has transformed over the last few decades”. Thanks to the author who put the classification beautifully with examples.

Client-Server Revolution → Systems of records It was the client-server revolution that first enabled broad use of information technology to manage business. Organizations first built systems of records: Customer Relationship Management (CRM) systems; Human Capital Management (HCM) systems for HR; and Enterprise Resource Planning (ERP) systems for financials and key assets.

Internet Revolution → System of engagement The rise of the internet, mobile, and chat allowed us to create systems of engagement that interfaced between the systems of records and interacted directly with customers and suppliers.

AI Revolution → System of intelligence What is emerging now are systems of intelligence that integrate data across all systems of record, connect directly to systems of engagement, and build systems that understand and reason with the data. These systems can drive workflows and management processes, optimize operations, and drive intelligent interactions with customers, employees, suppliers, and stakeholders.

Below is our Microsoft AI platform story covered in one slide deck.

image

If you are wondering how your organization can start the AI journey today, then below is the some of the key resources for learning,

  1. Azure AI -> A page where our Microsoft AI story is well articulated (In the page, scroll down for ‘AI Services’).
  2. Intelligent KIOSK –> must try windows app to demonstrate Pre-built AI (Cognitive APIs) & store url
  3. Seeing AI –> Great demo app on iOS using our cognitive APIs. Good to install and check the capability it brings in
  4. Conference Buddy –> ingredients needed to develop an intelligent chatbot. sample code for try one.
  5. Microsoft AI School –> Another great learning resource our Services and ML offerings
  6. The JFK Files –> Cognitive Search – An AI-first approach to content understanding – code

update: 6/26
http://unearth.ai/
https://alice.unearth.ai/
http://wolterskluwereap.azurewebsites.net/Home/Search
https://text-analytics-demo-dev.azurewebsites.net/

update 12/28

https://docs.microsoft.com/en-us/azure/cognitive-services/Text-Analytics/Tutorials/tutorial-power-bi-key-phrases
https://rare-technologies.com/text-summarization-with-gensim/
http://webmedsearch.azurewebsites.net/
https://github.com/liamca
https://github.com/liamca/medical-ner-search
https://github.com/liamca/BM25_Key_Phrase_Extraction
https://github.com/liamca/keyphrase_extraction_and_summarization_over_custom_content

Happy Learning !!

2018-06-02 Posted by | AI, Azure, ML | | Leave a comment

[Azure HPC] Intro to HPC and steps to setup CycleCloud in Azure

<update:9/2/2018>

Aug 31, Our CycleCloud team hits general availability in Azure. It's a tool for creating, managing, operating, and optimizing HPC clusters of any scale in Azure.Azure CycleCloud is available in the Microsoft Download Center, Azure Marketplace, and Azure Container Registry,
Azure CycleCloud announcement
Azure CycleCloud product page
Documentation
Azure CycleCloud download
Azure Marketplace offering for Azure CycleCloud
Azure Container Registry container

The following key scenarios are met by CycleCloud:
• Ability to run Linux & Windows HPC Clusters with traditional schedulers, including Slurm, PBS Pro, HPC Pack, Spectrum LSF and Symphony, Grid Engine, or HTCondor.
• Easily managing HPC clusters with multiple VM families and sizes to get capacity for critical runs
• Customizable workload templates that serve as best-practice starting points for Azure deployments
• Active directory integration for access to and management of compute environments

</update>

As part of Microsoft Internal MOOC course “Big Compute: Uncovering and Landing Hyperscale Solutions in Azure”, I was introduced to CycleCloud and learned how to setup CycleCloud in my Azure subscription. I would like to blog about some of my HPC learning + steps followed to setup one.

What is HPC? High Performance computing(HPC) is a parallel processing technique for solving complex computational problems. HPC applications can scale to thousands of compute cores. We can run these workloads in our premise by setting up clusters, extend the burst volume to cloud or run as a 100% cloud native solution.

image

Where is Big Compute used, usecase ? Usually compute intensive operations are best suited for this workload.

image

How HPC can be achieved in Microsoft Azure?

1) Azure Batch –>managed service, “cluster” as a service, running jobs, developers can write application that submit jobs using SDK, cloud native, HPC as a service, Pay as you go billing

2) CycleCloud –>acquired by MS, “cluster” management software aka orchestration software, supports hybrid clusters, multi cloud, managing and running clusters, one time license, you have complete control of the cluster and nodes

3) CrayComputer –>partnership with CrayComputer, famous weather forecasting service

4) HPC pack in Azure Infra–> Marketplace offerings  {HPC Applications, HPC VM images, HPC storages}

Azure Batch doesn’t need intro as it is there for quite sometime, setting up a Batch is very easy. Tools like Batch Labs helps us to monitor/control the Batch job effortlessly. Batch SDK helps us to integrate with existing legacy application easily to submit the job or manage the entire batch operation using their custom developed application. The end uses need not to login to Azure portal for submitting the jobs.

What is CycleCloud? CycleCloud provides a simple, secure, and scalable way to manage compute and storage resources for HPC and Big Compute/Data workloads in Cloud. CycleCloud enables users to create environments in Azure. It supports distributed jobs and also parallel workloads to tightly-coupled applications such as MPI jobs on Infiniband/RDMA. By managing resource provisioning, configuration, and monitoring, CycleCloud allows users and IT staff to focus on business needs instead infrastructure.

image

image

How to set it up in Azure? Steps are already documented here, I am trying to put the same steps in screenshot for easy reference.

1) Download the json files to your local drive. Say, c:temp

2) Generate the Service Principle

3) Generate SSH pub and private key

4) Clone the repo file to your local drive, say c:temp

git clone https://github.com/azurebigcompute/Labs.git 

5) Edit the vms-params.json file to specify the generated rsaPublicKey parameter from Step3. The cycleDownloadUri and cycleLicenseSas parameters have been pre-configured, but if you procure license then you need to update these two params as well. For now, I am leaving as it..

image

6) Now login to Azure CLI, create resource group, storage account, create VNET deployment and at last create VMs

C:temp>az login

C:temp>az group create --name "cycle-rg" --location "southeastasia"

C:temp> az storage account create --name "mikkyccStorage" --group "cycle-rg" --location "southeastasia" --sku "Standard_LRS"

C:temp>az group deployment create --name "vnet_deployment" --resource-group "cycle-rg" --template-uri https://raw.githubusercontent.com/azurebigcompute/Labs/master/CycleCloud/deploy-vnet.json --parameters vnet-params.json

C:temp>az group deployment create --name "vms_deployment" --resource-group "cycle-rg" --template-uri https://raw.githubusercontent.com/azurebigcompute/Labs/master/CycleCloud/deploy-vms.json --parameters vms-params.json

cyc3


7) Post the deployment, you will find the above set of resources created in our resource group say “cycle-rg”. Select the Cycleserver VM and copy the IP address to see if you can browse CycleCloud setup page.

image

8) Pls note, the installation uses a self-signed SSL certificate, which may show up with a warning in your browser. So, it is safe to ignore the warning and add it as exception to get the page like the after setting up the cluster (refer configure “CycleCloud Server” section from this page). If you get the below page after all the setup, then we are ready to create new cluster and submit the jobs.

image

9) Refer the section as it is “Creating a Grid Engine Cluster” 5.1 as it is from here

10) After the cluster is created, we need to start the cluster and see it is running like the below.

image

11) Now our Grid Engine cluster is ready for the job submission, For security reasons, the CycleCloud VM (CycleServer) is behind a jump box/bastion host. To access CycleServer, we must first log onto the jump box, and then ssh onto the CS instance. To do this, we’ll add a second host to jump through to the ssh commands.

From Azure portal, retrieve the admin box DNS and construct the SSH command as in screenshot. The idea is to “ssh –J” to our CycleServer through CycleAdmin box. One cannot directly ssh into CycleServer which is for security.

$ ssh -J cycleadmin@{JUMPBOX PUBLIC HOSTNAME} cycleadmin@cycleserver -i {SSH PRIVATE KEY}

cyc

12) Once we get into CycleAdmin@CycleServer, first change into root user and call CycleCloud Initialize command. You need to enter the username and password for that machine.

image

13) Connecting to the Grid Engine Master as

[root@cycleserver ~]$ cyclecloud connect master –c <clustername>

image

14) Now ready to submit our first job, qstat is to query the status of grid engine jobs and queues & qsub is to submit the batch jobs.

image

15) On successful submission, we should see the job started executing in our nodes.

read16

Master takes the batch job and getting executed from 3 nodes spin under execute node template

image

image

By the way, if we login the Azure portal and navigate to the RG, then we would see there is VMSS created as part of execute worker nodes.

image

image

we could also set the autoscaling feature from CycleCloud cluster settings, so the Azure VM’s comes and goes away once the job is completed. We have submitted 100 jobs per our command so it will request 100 cores. Based on the cluster core limit, it will decide whether to scale till that or not. Let say, if we have set 100 cores as cluster scale limit, then we would see many other VM’s also getting created to complete the task in parallel.

[cyclecloud@ip-0A000404 ~]$ qsub -t 1:100 -V -b y -cwd hostname

Once the job is completed, we can terminate the cluster and also delete the RG if you don’t want to retain which is our last step. I know it’s a bit of learning + confusing to start for the first time, but once you hands-on then it is easy to setup whenever you require and dispose off after completing our jobs.

Happy learning !

2018-03-31 Posted by | Azure, HPC | , , , | Leave a comment

[AAD] How to create Service Principal through CLI

There are multiple ways to generate the Service Principal for Azure AD. Say, through portal, CLI or PowerShell. I always used Azure portal for this registration. But started liking CLI way of generating principal which is very simple and easy to register and generate the required keys and move on. Yes, many times you would find this step as a prerequisites or in mid way to continue say Azure Data Lake Analytics query or ADAL programming.

$ az login
$ az account list -o table

$ az ad sp create-for-rbac --name MikkyDemoTraining --years 1

output:
{
"appId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"displayName": "MikkyDemoTraining",
"name": "http://MikkyDemoTraining",
"password": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"tenant": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}


Ps: Take note of the password value for later references, otherwise you may need to regenerate again.

For more detail – https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli?view=azure-cli-latest

2018-01-31 Posted by | AAD | | Leave a comment

[Linux] How to login Azure Linux VM’s using SSH key pair

This post is for Linux newbies trying to figure out SSH way login to Azure Linux VM. I am following the steps explained here. Had seen many times our windows users struggle to get this right at first shot. Hope the below screenshots are clear to follow and achieve easy logon. Ps note, there are many ways to get this done but I felt this as the quick way to get it right without jumping between tools/sites.

Step 1: I am using WSL but you can try Git Bash or bitvise or Putty or Tux vm or any other SSH client of your choice.

image

Pls note down the Key passphrase safely. This is required when we SSH to Linux VM from $ terminal.

Step 2: You would see the public and private keys generated at the path ~/.ssh. Cat out the id_rsa.pub file to grab the public key which is required when creating Azure Linux VM.

image

Step 3: Paste the above Public key at the time of VM creation in portal or CLI

image

Step 4: Once the VM is created, copy the SSH command to logon

image

Step 5: Go back to the your favorite SSH client and run the above copied command. Pls note, it will prompt for the passphrase which you have to enter now. On success, you would see your remote machine terminal.

image

Let me know if you see this helps you in some way.

Happy learning !

2018-01-30 Posted by | Azure, Linux, Open Source | | 2 Comments

[Azure PaaS] Why to consider Azure PaaS?

Happy new year ! As a Technical Evangelist, I work with bunch of ISV’s where I meet technical architects for engagements which includes Architectural design talk, review or POC’s assistance. To me, its easy to work with and explain Uber architects vs PowerPoint architects who resist PaaS services aggressively and often describe it’s a burden for them. As a leader in PaaS offerings, we encourages developers/startups to focus on their “apps” rather spending time on managing the underlying resources. It gives us a “real” freedom to operate cloud easily and also provide easy integration happy path to various tools, reports and monitoring. Here
I wanted to list out the advantages of adapting PaaS Service over IaaS.

1) Open and Hybrid: Azure is committed to being open and speak customer languages of their choice and platforms they prefer. We openly work with many open source communities, integrating the demands, acknowledging the development community movement and also contribute the same fix back to the community repos. By this way, It put us on a win/win situation. Hybrid path and options in Azure is so useful for someone to leverage their existing on Premise investments. Azure PaaS provides high control, high productivity + Intelligence platform which you can consider for both Open source and Hybrid scenario’s.

2) Data-driven Intelligence: Azure is the “only” cloud provider which provides comprehensive monitoring solutions to monitor both Cloud and On- Premises in a single pane. It has Azure Monitor, Application Insights, Log Insights etc helps to get various intelligence about the services easily. It also has the Azure Security Centre to helps us easily detect threats early and avoid false positives.

3) Continuous Innovation: Azure services can be easily integrated with VSTS which provides an end to end DevOps having planning, build & release and required tools. Azure Cognitive and AI services is way ahead of other providers. In fact, Azure provides 29 API’s for Cognitive Service which is a true value proposition and also a sign of Innovation.

4) Cross Platform: Using VS tools for Xamarin, developers can build native Android, iOS and windows apps sharing 90% of the code across device platforms. Non developers can also build scalable applications for desktop and mobile on top of cloud & On Premise services using PowerApps (no coding skills required).

5) Productivity & Tools: Azure offers unparalleled developer productivity tools for PaaS Development with Visual Studio through which one can even step into remote codes in few mins(remote debugging). 


Do you still believe as a burden?

#StayLearning..

2018-01-18 Posted by | Azure, Open Source, PaaS | | Leave a comment