Tuesday, September 7, 2021

Linux Mount Disk : blkid -o full and lsblk -f and lsblk and df -h

fda@FDA-VEA-VM:/$ blkid -o full
/dev/sda1: LABEL="cloudimg-rootfs" UUID="f89a10d0-2ae6-4411-9086-8ccd221055fd" TYPE="ext4" PARTUUID="b08788dd-af4a-4015-b7b0-f7b53b252ddd"
/dev/sda15: LABEL="UEFI" UUID="C4E4-E7F8" TYPE="vfat" PARTUUID="12798101-40c7-4dfe-8b16-58d8522bbbc0"
/dev/sdb1: LABEL="Temporary Storage" UUID="02BEE3C1BEE3AB7D" TYPE="ntfs" PARTUUID="29e34589-01"

fda@FDA-VEA-VM:/$ lsblk -f
NAME    FSTYPE LABEL           UUID                                 MOUNTPOINT
sda
├─sda1  ext4   cloudimg-rootfs f89a10d0-2ae6-4411-9086-8ccd221055fd /
├─sda14
└─sda15 vfat   UEFI            C4E4-E7F8                            /boot/efi
sdb
└─sdb1  ext4                   43e815d5-3bed-4f3b-a218-89a068dddc2c /mnt
sdc     ext4                   204db14b-9657-49b9-8daf-35ba202e295c
sr0

fda@FDA-VEA-VM:/$ lsblk
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda       8:0    0   30G  0 disk
├─sda1    8:1    0 29.9G  0 part /
├─sda14   8:14   0    4M  0 part
└─sda15   8:15   0  106M  0 part /boot/efi
sdb       8:16   0   32G  0 disk
└─sdb1    8:17   0   32G  0 part /mnt
sdc       8:32   0  150G  0 disk
sr0      11:0    1  628K  0 rom

fda@FDA-VEA-VM:/$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            7.9G     0  7.9G   0% /dev
tmpfs           1.6G  688K  1.6G   1% /run
/dev/sda1        29G  1.4G   28G   5% /
tmpfs           7.9G     0  7.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/sda15      105M  6.6M   98M   7% /boot/efi
/dev/sdb1        32G   49M   30G   1% /mnt
tmpfs           1.6G     0  1.6G   0% /run/user/1000

Sunday, September 5, 2021

How to debug Azure VM Issues

https://docs.microsoft.com/en-us/troubleshoot/azure/virtual-machines/troubleshoot-recovery-disks-portal-linux

https://www.hiroom2.com/2018/04/30/ubuntu-1804-serial-console-en/#sec-1

https://tldp.org/HOWTO/Remote-Serial-Console-HOWTO/configure-boot-loader-grub.html

https://www.hiroom2.com/2018/04/30/ubuntu-1804-serial-console-en/

https://askubuntu.com/questions/924913/how-to-get-to-the-grub-menu-at-boot-time-using-serial-console

https://www.youtube.com/watch?v=sVMgZ9YW6i8

https://www.lcn.com/support/articles/how-to-show-hidden-files-in-ftp/

https://askubuntu.com/questions/391082/how-to-see-time-stamps-in-bash-history




SSH Not Getting Connected : Azure VM

 Settings   ->  Disks

Settings   ->  Properties  -> Agent status : Not Ready  or Ready


TTY


Sys REQ 

Grub Loader

Serial Console

sysctl -a |grep -i sysrq


https://www.youtube.com/watch?v=KevOc3d_SG4&t=147s

https://www.youtube.com/watch?v=HnvUxnNzbe4

https://docs.microsoft.com/en-us/troubleshoot/azure/virtual-machines/serial-console-grub-proactive-configuration 


https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html


waagent 

https://github.com/Azure/WALinuxAgent

The Microsoft Azure Linux Agent (waagent) manages Linux provisioning and VM interaction with the Azure Fabric Controller.


What is Azure fabric?

Azure Service Fabric is a distributed systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices and containers


Operations   ->

Monitoring  ->

Automation  ->


Support + troubleshooting  ->  Resource health

Support + troubleshooting  ->  Boot diagnostics

Support + troubleshooting  ->  Performance diagnostics

Support + troubleshooting  ->  Serial console


Connect -> Connect with Bastion Host 

https://docs.microsoft.com/en-us/azure/bastion/tutorial-create-host-portal

https://www.rebeladmin.com/2019/11/step-step-guide-access-azure-vms-securely-using-azure-bastion/


Role

https://docs.microsoft.com/en-us/azure/role-based-access-control/check-access



Azure VM     ->    Support + troubleshooting  ->   Boot diagnostics

Boot Diagnostics

https://docs.microsoft.com/en-us/troubleshoot/azure/virtual-machines/serial-console-grub-single-user-mode

https://docs.microsoft.com/en-us/troubleshoot/azure/virtual-machines/boot-diagnostics

https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#virtual-machine-contributor



GrubLoader Issue

https://docs.microsoft.com/en-us/troubleshoot/azure/virtual-machines/troubleshoot-vm-boot-error

https://gutsytechster.wordpress.com/2018/07/24/how-to-resolve-grub-error-file-grub-i386-pc-normal-mod-not-found/

https://docs.microsoft.com/en-us/troubleshoot/azure/virtual-machines/serial-console-grub-proactive-configuration

https://www.youtube.com/watch?v=KevOc3d_SG4

https://askubuntu.com/questions/266429/error-file-grub-i386-pc-normal-mod-not-found



10.79.202.5

fda

Rage@1234567


azureubuntu


azlinux

R....1......e2021


GRand Unified Bootloader (GRUB) is likely the first thing you see when you boot a virtual machine (VM). Because it's displayed before the operating system has started, GRUB isn't accessible via SSH. In GRUB, you can modify your boot configuration to boot into single-user mode, among other things.


REISUB



az vm start -g CORA-AI -n FDA-VEA


az vm restart -g CORA-AI -n FDA-VEA


az vm restart -g CORA-AI -n FDA-VEA --force  --no-wait


az serial-console send reset -g CORA-AI -n FDA-VEA


az serial-console send reset -g CORA-AI -n FDA-VEA


az vm boot-diagnostics get-boot-log -g CORA-AI -n FDA-VEA


az serial-console connect -g CORA-AI -n FDA-VEA


az serial-console send reset -g CORA-AI -n FDA-VEA


az vm boot-diagnostics enable -g CORA-AI -n FDA-VEA





$subscriptionId=$(az account show --output=json | jq -r .id)


az resource show --ids "/subscriptions/$subscriptionId/providers/Microsoft.SerialConsole/consoleServices/default" --output=json --api-version="2018-05-01" | jq .properties

Monday, August 30, 2021

Kubectl Commands : Master List

kubectl get pods -n cs
kubectl get svc
kubectl get pods -o wide
kubectl exec -it <podName> -n fda-qa /bin/bash
kubectl describe <podName>
-------------------------------------
kubectl apply -f csv.yml
-------------------------------------
sudo az acr login --name coraaidev
-------------------------------------
kubectl logs <podName> -n cs
 kubctl delete pod <podName> -n cs
 -------------------------------------
sudo docker build -t dev.azurecr.io/hello-service  .
 sudo docker push dev.azurecr.io/hello-service
sudo docker images
-------------------------------------
sudo docker build -t association-service .
sudo docker tag association-service:latest coraaidev.azurecr.io/association-service:latest
docker tag -t  coraidev.azureecr.io/vea-cs:latest .
sudo docker push coraidev.azureecr.io/vea-cs:latest

AWS Notes - Useful

https://aws.amazon.com/premiumsupport/knowledge-center/manage-service-limits/

How do I manage my AWS service quotas?

For all other quota increase requests, create a case in the AWS Support console, and then choose Service Limit Increase.

-------------------------------------

https://spanning.com/blog/types-of-backup-understanding-full-differential-incremental-backup/

How Many Types of Backup are There?

There are mainly three types of backup: full, differential, and incremental.

Full - Entire Dataset regardless of any previous backups

Differential - Additions or alterations since most recent full backup

Incremental - Additions or alterations since most recent Incremental backup.

https://1tskcg39n5iu1jl9xp2ze2ma-wpengine.netdna-ssl.com/wp-content/uploads/2020/03/types-of-backup-full-differential-incremental.png

-------------------------------------

Amazon EBS volumes are placed in a specific Availability Zone where they are automatically replicated to protect you from the failure of a single component. 

All EBS volume types offer durable snapshot capabilities and are designed for 99.999% availability.

At no additional charge to you, Amazon EBS volume data is replicated across multiple servers in an Availability Zone to prevent the loss of data from the failure of any single component.

https://aws.amazon.com/ebs/features/

-------------------------------------

What Is the Difference Between AWS Snapshot and Backup?

https://www.nakivo.com/blog/difference-aws-snapshot-backup/


-------------------------------------

https://www.nagarro.com/en/blog/a-quick-guide-to-disaster-recovery-solution-with-aws

https://docs.aws.amazon.com/whitepapers/latest/disaster-recovery-workloads-on-aws/disaster-recovery-options-in-the-cloud.html

AWS offers 4 basic techniques for back-up and disaster recovery.,

Backup and Restore   $

Pilot Light   $$

Warm Standby $$$

Multisite $$$ (Almost Realtime)


Recovery Time Objective

Recovery Point Objective

-------------------------------------

https://www.bangkokpost.com/tech/1153473/aws-makes-play-through-new-services

Snowmobile - Exabytes level data 


With the new Snowmobile service, AWS said a person could ship one exabyte (an exabyte is 1,000 petabytes) of data to AWS in about six months -- a feat that would take 26 years over a 10Gbps dedicated connection.

-------------------------------------

https://medium.com/@gabanox/aws-data-replication-and-redundancy-with-managed-services-2e4d2a0fe98e

AWS Cross-Region Replication (CRR) 

S3 Replication and Redundancy with Managed Services in AWS

"Source Bucket" in diff region same Account

"Destination Bucket" - in diff  Region same account

Add a replication Configuration on "Source Bucket" and it asynchronously copies Objects with or without Tags to Another destination Bucket

-------------------------------------

https://www.msp360.com/resources/blog/geo-redundancy-comparison-amazon-s3-microsoft-azure-google-cloud/


Amazon S3 Geo-Redundancy and Replication

Amazon S3, the storage service on AWS, provides two types of geo-redundancy options.


S3 Availability Zones

The first method for achieving geo-redundancy on AWS is by using what AWS calls Availability Zones. Each AWS region includes multiple Availability Zones, which are geographically distant from each other.


By default, the Standard, Infrequent Access and Glacier storage classes on S3 replicate data automatically across at least three Availability Zones. This means that as long as you are using one of these S3 storage classes, your data will be geo-redundant, without any extra effort required on your part. The cost of this AWS geo-redundancy is built into the standard S3 pricing.


The major downside to achieving AWS geo-redundancy via this approach is that the Availability Zones within the same AWS region are still somewhat close together. Amazon is not specific about how close they are to each other, but says only that they are separated by “miles.” As such, they will suffice to protect against disruptions that are very localized, such as a fire or cooling system failure that affects just one server room. However, a large-scale disaster, such as major flooding or an earthquake, could impact multiple Availability Zones within the same region; in that case, your data may cease to be available despite the geo-redundancy that you have established via Availability Zones.


AWS Cross-Region Replication (CRR)

-------------------------------------

Amazon S3 Reduced Redundancy Storage

https://aws.amazon.com/s3/reduced-redundancy/

 

-------------------------------------

Durability

Standard                                                           99.999999999%

Standard - Infrequent Access 99.999999999%


Reduced Redundancy Storage 99.99%


-------------------------------------

8 Coding Challenges and Competitions That May Lead to Money or Jobs

https://www.makeuseof.com/tag/si-coding-challenges-lead-money-jobs/

-------------------------------------

https://aws.amazon.com/about-aws/global-infrastructure/?p=ngi&loc=0

-------------------------------------

https://aws.amazon.com/ec2/instance-types/

https://www.parkmycloud.com/blog/ec2-instance-types/

https://p2zk82o7hr3yb6ge7gzxx4ki-wpengine.netdna-ssl.com/wp-content/uploads/Screen-Shot-2020-02-21-at-1.29.51-PM-1536x992.png

-------------------------------------

https://aws.amazon.com/backup/

-------------------------------------

Amazon FSx

-------------------------------------

Amazon Data Lifecycle Manager

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshot-lifecycle.html


-------------------------------------

Create an Amazon EBS-backed Linux AMI

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html

-------------------------------------

SCP : Source Control Policies

Root Account : No resource here

Member Account : Children Accounts

Policies applied here those applied at Individual Account Level at AWS IAM

https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html

-------------------------------------

IAM user limit is 5000 per AWS account. 

https://stackoverflow.com/questions/28689364/aws-iam-users-limit-if-exceeds

The default maximum limit is 5000 users per AWS account. Beyond which you need to workout a solution with STS - http://docs.aws.amazon.com/STS/latest/UsingSTS/Welcome.html.

-------------------------------------

https://aws.amazon.com/fsx/windows/

Amazon FSx for Windows File Server provides fully managed, highly reliable, and scalable file storage that is accessible over the industry-standard Server Message Block (SMB) protocol. It is built on Windows Server,

-------------------------------------

Updating stacks using change sets

https://docs.amazonaws.cn/en_us/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html

When you need to update a stack, understanding how your changes will affect running resources before you implement them can help you update stacks with confidence. Change sets allow you to preview how proposed changes to a stack might impact your running resources, for example, whether your changes will delete or replace any critical resources, Amazon CloudFormation makes the changes to your stack only when you decide to execute the change set, allowing you to decide whether to proceed with your proposed changes or explore other changes by creating another change set.


-------------------------------------

Choosing a routing policy for AWS Route 53

https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html

-------------------------------------

https://aws.amazon.com/s3/transfer-acceleration/

Amazon S3 Transfer Acceleration can speed up content transfers to and from Amazon S3 by as much as 50-500% for long-distance transfer of larger objects. 

-------------------------------------

Capacity Reservation 

Reserved Instances  -  Discounted Pricing - You commit USAGE

Savings Plan - Discounted Pricing - You commit SPEND


There are two classes of Reserved Instances:

Standard Reserved Instances lock you into using one instance family, on the same operating system.

Convertible Reserved Instances offer the flexibility to change families, operating systems and tenancy, but at the cost of a slightly smaller discount


https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html

https://www.cloudhealthtech.com/blog/aws-reserved-instances-vs-on-demand

-------------------------------------

https://aws.amazon.com/professional-services/CAF/

AWS Cloud Adoption Framework

AWS Professional Services created the AWS Cloud Adoption Framework (AWS CAF) to help organizations develop and execute efficient and effective plans for their cloud adoption journey.

-------------------------------------

ECS vs Fargate

https://www.dragonspears.com/blog/aws-container-orchestration-101-ecs-vs-fargate-vs-eks

https://containersonaws.com/introduction/ec2-or-aws-fargate/

https://cloudonaut.io/ecs-vs-fargate-whats-the-difference/

https://cloudonaut.io/images/2019/02/ecs-container-instance-fargate@730w.webp

ECS --->  Uses EC2 or

Uses Fargate

-------------------------------------


EBS snapshots should be directly compared to replicas as they 


Replication

Replication creates a copy of your data which is stored in an identical format as the original

data. Because your replica is the same as your original machine, you can simply power on the

replica for instant disaster recoveryprovide similar functionality


Backup

A backup is a copy of your data that is stored in a special format in order to reduce the data

size and enable a full/granular recovery. Backups allow you to recover all or part of the data

from weeks, months, or even years ago. At the same time, backups take up a fraction of the

storage space when compared to the original data size


-------------------------------------

Tuesday, August 24, 2021

CORS : How to handle CORS in Server code

@CrossOrigin(origins = "http://example.com")




1
2
3
4
@CrossOrigin(origins = "http://example.com", maxAge = 3600)
@RestController
@RequestMapping("/account")
public class AccountController {

Azure - Pipeline - Add Approver for Stage

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass