Showing posts with label Azure Stack. Show all posts
Showing posts with label Azure Stack. Show all posts

Wednesday, 29 June 2022

Deploy Arc Data Controller - Az command

 Here are some az command to deploy your azure arc data controller 

Prerequisite :

1. Az cli is installed 

2. Storage class ext4 deployed 

3. AKS HCI cluster deployed 

4. kubectl is installed 


here is the command 

az extension add --name k8s-extension

az extension add --name connectedk8s

az extension add --name k8s-configuration

az extension add --name customlocation

$namespace = "arc-dc"

$location = "arcdc" #custom location 

$region = "eastus"          #Azure region 

$subscription = "subname"   #subscription name 

#$subscriptionid = "abcdefg" #subscription id 

$rg = "RG"                  #RG name 

$cluster = "cluster01"      #cluster name 


az login 

az account set --subscription "subname"

az connectedk8s connect --subscription $subscription --resource-group $rg --name $cluster --location $region

az connectedk8s enable-features -n $cluster -g $rg --features cluster-connect custom-locations

az k8s-extension create --cluster-name $cluster --resource-group $rg --name $namespace --cluster-type connectedClusters --extension-type microsoft.arcdataservices --auto-upgrade true --scope cluster --release-namespace $namespace --config Microsoft.CustomLocation.ServiceAccount=sa-arc-bootstrapper


$akshciid = az connectedk8s show -n $cluster -g $rg  --query id -o tsv

$extensionid = az k8s-extension show --name arc-dc --cluster-type connectedClusters -c $cluster -g $rg  --query id -o tsv


az customlocation create --resource-group $rg --name $location --namespace $namespace --host-resource-id $akshciid --cluster-extension-ids $extensionid --location $region


#use portal to create data controller 

#Example:

#az arcdata dc create --profile-name azure-arc-aks-premium-storage --k8s-namespace arc --name arc --subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --resource-group my-resource-group --location eastus --connectivity-mode direct --use-k8s

#check deployment status 

kubectl get datacontrollers --namespace arc-dc

thanks for reading 

Monday, 28 February 2022

Azure Arc Data Controller on Azure Stack HCI - ext4 storage creation

 Hi all, continue on hybrid deployment for related topic on Azure Arc, this post will be focusing on creating a storage with fstype: ext4 in order to complete Azure Arc Data Controller deployment. 



Some common issue if this requirement is not meet is , it will cause the agent cannot be initialize. example here - click here 

The official guide is available at the end of the post but will show here how i made it possible in my test lab . 

1. Locate the config on yaml for default storage class. 
2. Take note on the group and hostname using tools or run this command - kubectl get storageclass default -o yaml
3. Three things needed to be apply in your new yaml to create that fstype:ext4 is 


  3.1 Name : this will appear as the name of your  new storage class 
  3.2 Container ; the file path for storing your persistence volume
  3.3 Group
  3.4 Hostname ; this is created based on your pre-stage your dns on deploying Azure Stack HCI at the beginning  

4. for my case, i did not create another custom storage container , i just use the same container as my default storage class 

5. you may deploy by using kubectl apply -f  /examplepathext4.yaml

6. After that you may try to deploy data controller again and put the name of your new storage class . 

reference link is here 

hope this will help in your journey to with azure arc data controller , thanks for reading and see you again 
 



Wednesday, 9 February 2022

AKS HCI Access Token - Azure Arc

Hello All, 

Having to play with kubernetes or K8s is great plus point and now, public cloud provider like microsoft has their manages service k8 offering; AKS to be running on Azure Stack HCI . 

As service is now running on your datacenter, but with azure arc integration , it also can be view from your azure portal with some parameter need to be pass to get the view 


i was abit struggling to find the token in order to view the k8 properties on portal but after sometimes, i manage to pull it. i will share the step here so it will be easier for you to get that token to be use in few place . Here is what you need

1. AKS running on HCI with azure arc enable 

2. try and error ; but i will make easier 

For me, i use free software to access my k8s cluster which is Lens , so browse through the secret in the k8 and look for some key word, one thing that caught my eyes is azure arc, so i click to look into the content of the secret. 



so i unhide the token and copy over the token and paste over in azure portal like the first picture and walla , all the namespace appear. 

i have also incorperate the token into my kube config because i want to use the same kube config to acess k8 either via lens or k8-dashbaord. here how u add into the existing kube config 


add the extra line with token : <your token> and pay attention on the allignment due to format. 

that all for now, thanks for reading and stay safe. 

Tuesday, 23 June 2020

Adding and Publish Custom image to Azure Stack 180513 **




Hello everyone, since there are a lot of changes happen on the way of uploading the Custom Image to Azure Stack, please note that this is tested on Azure Stack Development Kit Version 180513. There a few blog post that mainly focus on this but I will also share my method on Upload and Publish A custom Image to Azure Stack,


One of the concern in Azure Stack either is in Online mode of Offline mode, Red Hat Enterprise Linux (RHEL)will not able to be downloaded from Azure Marketplace. So, the only way to do have RHEL to be available in your Azure Stack is by uploading your own RHEL image on it. There a couple of prerequisites that need to be follow to make your RHEL running on Azure Stack. You may refer here to get a step to prepare your RHEL for Azure Stack. – Click Here
In my case, I don’t have RHEL running in my Environment, and I also don’t have any RHEL subscription registered so I can call the necessary repository for Preparation process.  So what I have done is i Deploy a RHEL 7.2 in my Azure environment.  I run the following command to provision the RHEL after the machine is running.


1. Sudo waagent -force -deprovision
2.  export HISTSIZE=0
3. logout .

After that I shutdown the machine and I export out the VHD and download it.

This method is only applicable if your RHEL image do not have any special config it. 

Once the VHD completely downloaded, you may rename it and upload the image to your Azure Stack. Uploading image can be done using GUI. Upload it as Page blob .



After the VHD successfully uploaded into storage account, a vm image need to be created using that VHD. The way to do this, by login in Operator Portal @ Admin Portal.  Click on dashboard > Compute > VM image .








 Fill in the details. The disk URL can be copied by going to blob properties of the VHD that we uploaded.
  



The VM image will appear after the process is done


Ok, we have gone through almost all the part.
Moving on, I download the azpkg using syndication; package file needed to publish the VM image in Azure Stack marketplace.
One the file has been downloaded. Change the extension from “.azpkg” to “.zip” for your to extract all the file inside.
This is the content of the file after being extracted.


Ok, we need to do some editing to make it able to choose the correct VM image and Display a desired display name,
1.  Manifest.JSON.

{"$schema": "https://gallery.azure.com/schemas/2015-10-01/manifest.json#",
                "name": "RHEL",
                "publisher": "Contoso",
                "version": "1.0.2",
        "displayName": "ms-resource:displayName",
Please match back the parameter for publisher and Version. Name can be varies because this is mainly for the record.
2. go to createuidefinition,json under DevelopmentTemplate  Folder.
Edit this parameter to mach back with VM image

"imageReference": {
      "publisher": "Contoso",
      "offer": "rhelserver",
      "sku": "rhel"
3. Go to String Folder and edit the resources.resjson using notepad.
Find these two lines and replace it accordingly
3.1 "displayName":"Red Hat Enterprise Linux","publisherDisplayName":"Constoso"
3.2 productDisplayName0":"Red Hat Enterprise Linux","productPublisherDisplayName0":"Contoso"

4. You can put your desired display icon by replacing all the icon that is in the Icons folder.
After Complete editing all the file and parameter.
You need create back the “.azpkg ” file by using Azurepackagegallery.exe through powershell not Powershell ISE.  I will advise using method here to do that instead of zip the folder and change the extension as during the Azurepackagegallery.exe process, it will check for syntax error.


Upload the “.azpkg” file and copy the link . run the following command to make your VM Image appear in  Marketplace.
 --> Add-AzsGalleryItem -GalleryItemUri https://addvmimagestorageaccount.blob.local.azurestack.external/addvmimagecontainer/Contoso.RHEL-Contoso.1.0.2.azpkg -Verbose



There will a ubuntu info as the “.azpkg” main file is for ubuntu 17.10 downloaded using syndication. I only change the necessary parameter for to work with RHEL VHD.



Thanks for reading,  sample “.azpkg” file with RHEL icon can be downloaded from Here.