Showing posts with label IaaS. Show all posts
Showing posts with label IaaS. Show all posts

Tuesday, June 7, 2022

Monitor oci compute instance using free audit service and perform analysis on a systematic way

There is a service in OCI known as Audit service which records calls to all supported Oracle Cloud Infrastructure public application programming interface (API) endpoints as log events. By default, Audit logs are retained for 365 days. Retention period is a tenancy-level setting. The value of the retention period setting affects all regions and all compartments. The retention period cannot be changed. Currently, all services support logging by Audit.


Information in the logs includes the following:


Time the API activity occurred

Source of the activity

Target of the activity

Type of action

Type of response


In this post, we will stop the instance and through audit service, we will find the details on who did what. 


We will open the compute instance and choose the Audit option






Click on filter options



Once we click on apply, the results will be displayed in below format



Now filter with "POST" 






Click on the drop down option on the right most side,




Expand the "StatusChange" option




Now to know who did it, click on the identity option




Thus in an environment, where you have many users accessing console and doing the activities, the OCI Audit Service helps us to know the details in a much granular manner. I hope this post will be helpful for someone. Till then, happy learning cloud








Sunday, March 28, 2021

how to configure GUI via VNC in OCI aka Oracle Cloud

Virtual Network Computing, or VNC, is a connection system that allows you to use your keyboard and mouse to interact with a graphical desktop environment on a remote server. It makes managing files, software, and settings on a remote server easier for users who are not yet comfortable with the command line.


Installation:


As root user: 

 

1) Install the following rpms:

yum install xorg-x11-xauth xterm 

yum install tigervnc-server 

yum -y install xterm* xorg* xclock xauth

 

2) Enable the firewall daemon process

systemctl status firewalld

 








 3) Sudo to user for installation and start vncserver


   vncserver :2 






4) Check if availability of 5902 port [2 as VNC port, if its 1 then post would be 5901…so on]

    





   

 

5) Add rule in ip table to allow traffic to 5902 port

            iptables -I INPUT -m state --state NEW -p tcp --destination-port 8001 -j ACCEPT


fir        firewall-cmd --zone=public --add-port=5902/tcp --permanent


fir       firewall-cmd --reload

   

 

6) Access vnc.

 



 

 


Thursday, January 14, 2021

resize boot volume in oracle cloud infrastructure aka OCI for a Linux instance

 

The Oracle Cloud Infrastructure Block Volume service lets you scaleup the size of block volumes and boot volumes. Well, one fine day, my boot volume was short of space and i was looking for some vaccum in my  mount point. I had the challenge, where  /u01 was mounted on boot volume and it had free space of 30 GB only. My requirement was to have around 150 GB. Thanks to OCI, we can scale up the boot volume. 

P.S:-As per https://docs.oracle.com/en-us/iaas/Content/Block/Tasks/resizingavolume.htm, we cannot scale up IDE type boot volume. Also we cannot scale down the boot volume.

 

Open the navigation menu in Oracle Cloud Infrastructure console. Under Core Infrastructure, go to Compute and click Boot Volumes.

 



 

 

In the Boot Volumes list, click the boot volume you want to resize.Click Edit Size or Performance.Specify the new size in VOLUME SIZE (IN GB). You must specify a larger value than the boot volume's current size.

 

 

 

After the volume is provisioned, for the volume resize to take effect, Log on to your instance and then paste and run the rescan commands
 
1. Run the applicable rescan commands.
sudo dd iflag=direct if=/dev/<device_name> of=/dev/null count=1
echo "1" | sudo tee /sys/class/block/<device_name>/device/rescan
2. Extend the partition manually. 
[opc@apps ~]$ sudo su -
Last login: Mon Jan 11 14:17:16 GMT 2021 on pts/0
[root@apps ~]# df -kh
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        7.2G     0  7.2G   0% /dev
tmpfs           7.3G     0  7.3G   0% /dev/shm
tmpfs           7.3G   25M  7.2G   1% /run
tmpfs           7.3G     0  7.3G   0% /sys/fs/cgroup
/dev/sda3       367G  333G   35G  91% /
/dev/sda1       200M  8.6M  192M   5% /boot/efi
tmpfs           1.5G     0  1.5G   0% /run/user/994
tmpfs           1.5G     0  1.5G   0% /run/user/1000
 
Now, extend the partition

[root@apps ~]# sudo /usr/libexec/oci-growfs
CHANGE: partition=3 start=17188864 old: size=769243102 end=786431966 new: size=1031387102 end=1048575966
Confirm? [y/n]y
CHANGED: partition=3 start=17188864 old: size=769243102 end=786431966 new: size=1031387102 end=1048575966
meta-data=/dev/sda3              isize=256    agcount=39, agsize=2515200 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=0        finobt=0 spinodes=0 rmapbt=0
         =                       reflink=0
data     =                       bsize=4096   blocks=96155387, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=4912, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 96155387 to 128923387
 
 
Confirm the changes
 
[root@apps ~]# df -kh
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        7.2G     0  7.2G   0% /dev
tmpfs           7.3G     0  7.3G   0% /dev/shm
tmpfs           7.3G   25M  7.2G   1% /run
tmpfs           7.3G     0  7.3G   0% /sys/fs/cgroup
/dev/sda3       492G  333G  160G  68% /
/dev/sda1       200M  8.6M  192M   5% /boot/efi
tmpfs           1.5G     0  1.5G   0% /run/user/994
tmpfs           1.5G     0  1.5G   0% /run/user/1000
[root@apps ~]#

 

 In this post, i have tried to demonstrate on how we can scale up the boot volume online in Oracle Cloud Infrastructure. Hope it helps someone. Happy learning Cloud.