<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Voravit Chamchoy on Medium]]></title>
        <description><![CDATA[Stories by Voravit Chamchoy on Medium]]></description>
        <link>https://medium.com/@zaturdayapril?source=rss-97b0203e1685------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5DH3pOJncUTdquXZ.</url>
            <title>Stories by Voravit Chamchoy on Medium</title>
            <link>https://medium.com/@zaturdayapril?source=rss-97b0203e1685------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 02:07:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zaturdayapril/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Openshift Virtualization with Windows VM Guest]]></title>
            <link>https://medium.com/@zaturdayapril/openshift-virtualization-with-windows-vm-guest-c3e4b6227a4a?source=rss-97b0203e1685------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3e4b6227a4a</guid>
            <category><![CDATA[ocpv]]></category>
            <category><![CDATA[ocp]]></category>
            <dc:creator><![CDATA[Voravit Chamchoy]]></dc:creator>
            <pubDate>Fri, 12 Dec 2025 08:43:41 GMT</pubDate>
            <atom:updated>2025-12-12T08:43:41.649Z</atom:updated>
            <content:encoded><![CDATA[<p>จากปัญหา BSOD performance ต่างๆ การทำงานของ disk เป็นส่วนสำคัญ ในบทความนี้ได้เอาวิธีการ เปลี่ยน และติดตั้งในระหว่างการทำงาน</p><p>VirtIO driver นั้นเป็น paravirtualized device drivers required for Microsoft Windows virtual machines driver นี้จะถูกส่งเข้ามาไว้ใน image ได้รับจากการ installation ไม่จำเป็นต้อง download เพิ่มเติม</p><p>The container-native-virtualization/virtio-win container disk must be attached to the VM as a SATA CD drive to enable driver installation. You can install VirtIO drivers during Windows installation or added to an existing Windows installation.</p><p>After the drivers are installed, the container-native-virtualization/virtio-win container disk can be removed from the VM.</p><h4><a href="https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/virtualization/managing-vms#virt-attaching-virtio-disk-to-windows_virt-installing-qemu-guest-agent">Attaching VirtIO container disk to Windows VMs during installation</a></h4><p>You must attach the VirtIO container disk to the Windows VM to install the necessary Windows drivers. This can be done during creation of the VM.</p><p><strong>Procedure</strong></p><ol><li>When creating a Windows VM from a template, click <strong>Customize VirtualMachine</strong>.</li><li>Select <strong>Mount Windows drivers disk</strong>.</li><li>Click the <strong>Customize VirtualMachine parameters</strong>.</li><li>Click <strong>Create VirtualMachine</strong>.</li></ol><p>After the VM is created, the virtio-win SATA CD disk will be attached to the VM.</p><h4><a href="https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/virtualization/managing-vms#virt-attaching-virtio-disk-to-windows-existing_virt-installing-qemu-guest-agent">Attaching VirtIO container disk to an existing Windows VM</a></h4><p>You must attach the VirtIO container disk to the Windows VM to install the necessary Windows drivers. This can be done to an existing VM.</p><p><strong>Procedure</strong></p><ol><li>Navigate to the existing Windows VM, and click <strong>Actions &gt; Stop</strong>.</li><li>Go to <strong>VM Details &gt;</strong> <strong>Configuration &gt;</strong> <strong>Storage</strong>.</li><li>Select the <strong>Mount Windows drivers disk</strong> checkbox.</li><li>Click <strong>Save</strong>.</li><li>Start the VM, and connect to a graphical console.</li></ol><p><strong>Appendix / Reference link:<br></strong><a href="https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/virtualization/managing-vms#installing-virtio-drivers">https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/virtualization/managing-vms#installing-virtio-drivers</a><br><a href="https://access.redhat.com/solutions/7128174?band=se&amp;seSessionId=f6bd3319-504e-4e94-af26-bd3b1615ba95&amp;seSource=Recommendation&amp;seResourceOriginID=e3af1b8d-8205-467d-a6ea-b84b75f54c9d">https://access.redhat.com/solutions/7128174?band=se&amp;seSessionId=f6bd3319-504e-4e94-af26-bd3b1615ba95&amp;seSource=Recommendation&amp;seResourceOriginID=e3af1b8d-8205-467d-a6ea-b84b75f54c9d</a><br><a href="https://access.redhat.com/articles/7129390?band=se&amp;seSessionId=f6bd3319-504e-4e94-af26-bd3b1615ba95&amp;seSource=Recommendation&amp;seResourceOriginID=568f700b-745c-416b-abbb-1d3bec00f8c3">https://access.redhat.com/articles/7129390?band=se&amp;seSessionId=f6bd3319-504e-4e94-af26-bd3b1615ba95&amp;seSource=Recommendation&amp;seResourceOriginID=568f700b-745c-416b-abbb-1d3bec00f8c3</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3e4b6227a4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OCPv]]></title>
            <link>https://medium.com/@zaturdayapril/ocpv-26c9279270e6?source=rss-97b0203e1685------2</link>
            <guid isPermaLink="false">https://medium.com/p/26c9279270e6</guid>
            <dc:creator><![CDATA[Voravit Chamchoy]]></dc:creator>
            <pubDate>Fri, 31 Oct 2025 04:26:25 GMT</pubDate>
            <atom:updated>2025-10-31T04:26:25.032Z</atom:updated>
            <content:encoded><![CDATA[<p>** this page require account redhat for read article</p><ul><li>Certifield for guest OS</li></ul><p><a href="https://access.redhat.com/articles/certified-hypervisors#ocpvirt">Certified Guest Operating Systems in Red Hat OpenStack Platform, Red Hat Virtualization, Red Hat OpenShift Virtualization and Red Hat Enterprise Linux with KVM - Red Hat Customer Portal</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*w8dKIUj40RI28IkW85uzIg.png" /><figcaption>reference redhat articles</figcaption></figure><p><a href="https://access.redhat.com/articles/4234591#known">Certified Guest Operating Systems in OpenShift Virtualization - Red Hat Customer Portal</a></p><ul><li>Article for OCPV FAQ for windows server</li></ul><p><a href="https://access.redhat.com/articles/7053119">Microsoft Windows Server on OpenShift Virtualization Supportability FAQ - Red Hat Customer Portal</a></p><ul><li>Article for optimize windows guest OS</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26c9279270e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ConfigMap with disk volume or fileweb content]]></title>
            <link>https://medium.com/@zaturdayapril/configmap-with-disk-volume-or-fileweb-content-2011350847f2?source=rss-97b0203e1685------2</link>
            <guid isPermaLink="false">https://medium.com/p/2011350847f2</guid>
            <category><![CDATA[red-hat-openshift]]></category>
            <dc:creator><![CDATA[Voravit Chamchoy]]></dc:creator>
            <pubDate>Fri, 26 Sep 2025 09:23:11 GMT</pubDate>
            <atom:updated>2025-09-26T09:23:11.087Z</atom:updated>
            <content:encoded><![CDATA[<p>Use the missing files to create a configuration map from the web console. Use the following information to create the configuration map for the web application:</p><p>Add webfile index.html on “Data”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*EtHeFxKuRhCd99U07uTsFg.png" /></figure><p>Add photo file redhatlogo.png on “Binary Data”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*rC-uDakK-bSv_a9ela66zw.png" /></figure><p>Mount the webfiles configuration map as a volume.<br>- set volume to deployment with command<br>- type to configmap and spacific mapfile to “webfiles”<br>- give name volume to “webfiles-vol” and bind path to “/var/www/html/” that is default path for httpd<br>** when volume mounted file and photo will be resting in correct location and service assume to “index.html” and give link for open picture “redhatlogo.png”</p><pre>oc set volume deployment/webconfig \<br>  --add --type configmap --configmap-name webfiles \<br>  --name webfiles-vol --mount-path /var/www/html/<br>deployment.apps/webconfig volume updated</pre><p>Verify spec deployment before update not found configmap and volume</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*aknjUg3GdzfK84O1op4eZQ.png" /><figcaption>this spec not configure mapvolume</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*RPJ9H5UOhOb-HKbiwWcqEw.png" /><figcaption>deployment has been volume and configure map file content and picture</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2011350847f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubenates readiness/liveness Probe]]></title>
            <link>https://medium.com/@zaturdayapril/kubenates-readiness-liveness-probe-29ebec3e1ff2?source=rss-97b0203e1685------2</link>
            <guid isPermaLink="false">https://medium.com/p/29ebec3e1ff2</guid>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[openshift]]></category>
            <dc:creator><![CDATA[Voravit Chamchoy]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 00:45:24 GMT</pubDate>
            <atom:updated>2025-09-18T00:45:24.976Z</atom:updated>
            <content:encoded><![CDATA[<p>ทำความเข้าใจแบบง่ายๆ</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: goproxy<br>  labels:<br>    app: goproxy<br>spec:<br>  containers:<br>  - name: goproxy<br>    image: registry.k8s.io/goproxy:0.1<br>    ports:<br>    - containerPort: 8080<br>    readinessProbe:<br>      tcpSocket:<br>        port: 8080<br>      initialDelaySeconds: 15<br>      periodSeconds: 10<br>    livenessProbe:<br>      tcpSocket:<br>        port: 8080<br>      initialDelaySeconds: 15<br>      periodSeconds: 10</pre><p><strong>Liveness Probes:<br></strong>จากส่วนที่เห็นคือ configure สำหรับ TCP check มันเหมือนจะเป็น http protocol เพราะว่า เป็น 8080 ในตัวอย่างนี้ใช้งานทั้ง readiness และ liveness probes <br>เริ่มต้นด้วย liveness probe<br>- หลังจาก container start แล้วนั้น <em>{ initialDelaySeconds: 15}</em> เข้าไปเช็ค 15 วินาทีแรก<br>-ต่อมาสิ่งที่จะเช็คคือ 8080 <em>{ tcpSocket.port: 8080 } </em>ของ goproxy ถ้ามันเจอว่า start ไม่ได้ จะดำเนินการ restart และ<br>- หากเจอก็จะเข้าไปเช็คต่อเนื่องทุกๆ 10 วินาที <em>{ periodSeconds: 10 }</em></p><p><strong>Readiness Probes:<br></strong>หลังจาก container started แล้ว 15 วินาที rediness probe<br>โดยจะทำคล้ายกับ liveness คือเข้าไปเช็ค 8080 ที่ goproxy</p><p>ถ้า Succeds pod จะยังให้ status ready และจะยังเปิดรับ connection จาก service<br>ถ้า Fails pod จะเป็น unready คือจะไม่รับ connection จาก service</p><p>To try the TCP liveness check, create a Pod:</p><pre>kubectl apply -f https://k8s.io/examples/pods/probe/tcp-liveness-readiness.yaml</pre><p>After 15 seconds, view Pod events to verify that liveness probes:</p><pre>kubectl describe pod goproxy</pre><p>ตัวอย่างที่ได้จาก</p><p><a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/">https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29ebec3e1ff2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Splunk HEC Globally]]></title>
            <link>https://medium.com/@zaturdayapril/splunk-hec-globally-d4fac128c018?source=rss-97b0203e1685------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4fac128c018</guid>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[splunk]]></category>
            <category><![CDATA[splunk-administration]]></category>
            <dc:creator><![CDATA[Voravit Chamchoy]]></dc:creator>
            <pubDate>Thu, 14 Aug 2025 08:02:20 GMT</pubDate>
            <atom:updated>2025-08-14T08:02:20.282Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Enable HEC Globally (If not already enabled)</strong></h3><p>First, you need to make sure the HTTP Event Collector is turned on for your entire Splunk instance.</p><ol><li>Log in to your Splunk instance.</li><li>In the top-right corner, click on <strong>Settings</strong> &gt; <strong>Data Inputs</strong>.</li><li>Under “Local inputs,” click on <strong>HTTP Event Collector</strong>.</li><li>Click the <strong>Global Settings</strong> button in the top-right.</li><li>For <strong>All Tokens</strong>, click the <strong>Enabled</strong> button.</li><li>You can leave the default port as 8088.</li><li>Click <strong>Save</strong>.</li></ol><h3>Create a New HEC Token</h3><p>Now you can create the specific token that OpenShift will use. For your hybrid scenario, it’s best to create one token and give it access to all the necessary indexes.</p><ol><li>Go back to the <strong>HTTP Event Collector</strong> page (<strong>Settings</strong> &gt; <strong>Data Inputs</strong> &gt; <strong>HTTP Event Collector</strong>).</li><li>Click the <strong>New Token</strong> button in the top-right.</li><li><strong>Name &amp; Description</strong>: Give your token a descriptive name, like openshift-log-forwarder.</li><li>Click <strong>Next</strong>.</li><li><strong>Input Settings</strong>: This is the most important step for your setup.<br>- <strong>Source type</strong>: You can leave this blank or click <strong>Select</strong> and choose a default like _json.<br>- <strong>App Context</strong>: Select Search &amp; Reporting (search).<br>- <strong>Allowed Indexes</strong>: Click on the <strong>Select</strong> button. In the “Available items” list, find and add openshift_audit, openshift_prod, and openshift_dev_errors to the &quot;Selected items&quot; list.<br>- <strong>Default Index</strong>: Choose one of your indexes to be the default, for example, openshift_prod.</li></ol><p>6. Click <strong>Review</strong>, and then click <strong>Submit</strong>.</p><h3>Collect Your Token</h3><p>After you click submit, Splunk will show you a screen with the message “Token has been created successfully.”</p><ul><li><strong>Token Value</strong>: The long string of letters and numbers displayed is your <strong>HEC Token</strong>.</li><li><strong>Copy this value immediately</strong> and save it somewhere secure. You will use this value when you create the splunk-hec-token secret in OpenShift.</li></ul><p>Once you click “Done,” you will not be able to see the token value again. If you lose it, you’ll have to generate a new one.</p><p>This <a href="https://www.youtube.com/watch?v=9awwyjORWO8">video walkthrough on setting up Splunk HEC</a> provides a visual guide to the process, which can be helpful to follow along with.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4fac128c018" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Storage Scale reduce disk on FS]]></title>
            <link>https://medium.com/@zaturdayapril/storage-scale-reduce-disk-on-fs-f0641b141f5a?source=rss-97b0203e1685------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0641b141f5a</guid>
            <category><![CDATA[gpfs]]></category>
            <dc:creator><![CDATA[Voravit Chamchoy]]></dc:creator>
            <pubDate>Fri, 08 Aug 2025 14:24:55 GMT</pubDate>
            <atom:updated>2025-08-08T14:24:55.577Z</atom:updated>
            <content:encoded><![CDATA[<p>how to reduce disk on filesystem</p><pre>[root@gpfs01 ~]# mmlsdisk demo-fs<br>disk         driver   sector     failure holds    holds                            storage<br>name         type       size       group metadata data  status        availability pool<br>------------ -------- ------ ----------- -------- ----- ------------- ------------ ------------<br>nsd02        nsd         512           1 yes      yes   ready         up           system<br>nsd03        nsd         512           1 yes      yes   ready         up           system<br>nsd04        nsd         512           1 yes      yes   ready         up           system<br>nsd05        nsd         512           1 yes      yes   ready         up           system<br>[root@gpfs01 ~]#<br>[root@gpfs01 ~]# mmlsconfig tiebreakerDisks<br>tiebreakerDisks nsd01<br>[root@gpfs01 ~]# mmdeldisk demo-fs nsd05<br>Deleting disks ...<br>Scanning file system metadata, phase 1: inode0 files<br>  24 % complete on Fri Aug  8 10:18:20 2025<br> 100 % complete on Fri Aug  8 10:18:20 2025<br>Scan completed successfully.<br>Scanning file system metadata, phase 2: block allocation maps<br> 100 % complete on Fri Aug  8 10:18:20 2025<br>Scan completed successfully.<br>Scanning file system metadata, phase 3: reserved thin-provisioning<br>Scan completed successfully.<br>Scanning file system metadata, phase 4: inode allocation map<br> 100 % complete on Fri Aug  8 10:18:20 2025<br>Scan completed successfully.<br>Scanning file system metadata, phase 5: fileset metadata files<br> 100 % complete on Fri Aug  8 10:18:20 2025<br>Scan completed successfully.<br>Scanning user file metadata ...<br> 100.00 % complete on Fri Aug  8 10:18:28 2025  (    133632 inodes with total       1578 MB data processed)<br>Scan completed successfully.<br>Checking Allocation Map for storage pool system<br>tsdeldisk completed.<br>mmdeldisk: Propagating the cluster configuration data to all<br>  affected nodes.  This is an asynchronous process.<br>[root@gpfs01 ~]# mmdf demo-fs<br>disk                disk size  failure holds    holds           free in KB          free in KB<br>name                    in KB    group metadata data        in full blocks        in fragments<br>--------------- ------------- -------- -------- ----- -------------------- -------------------<br>Disks in storage pool: system (Maximum disk size allowed is 126.00 GB)<br>nsd03                 2097152        1 yes      yes         1498624 ( 71%)          1112 ( 0%)<br>nsd04                 2097152        1 yes      yes         1498624 ( 71%)           888 ( 0%)<br>nsd02                 2097152        1 yes      yes         1499136 ( 71%)           888 ( 0%)<br>                -------------                         -------------------- -------------------<br>(pool total)          6291456                               4496384 ( 71%)          2888 ( 0%)<br><br>                =============                         ==================== ===================<br>(total)               6291456                               4496384 ( 71%)          2888 ( 0%)<br><br>Inode Information<br>-----------------<br>Number of used inodes:            4038<br>Number of free inodes:          129594<br>Number of allocated inodes:     133632<br>Maximum number of inodes:       133632<br>[root@gpfs01 ~]# df -h<br>Filesystem             Size  Used Avail Use% Mounted on<br>devtmpfs               4.0M     0  4.0M   0% /dev<br>tmpfs                  7.7G   16K  7.7G   1% /dev/shm<br>tmpfs                  3.1G  321M  2.8G  11% /run<br>/dev/mapper/rhel-root   17G  5.8G   11G  35% /<br>/dev/sda2              960M  219M  742M  23% /boot<br>/dev/sda1              599M  7.1M  592M   2% /boot/efi<br>tmpfs                  1.6G     0  1.6G   0% /run/user/0<br>demo-fs                6.0G  1.8G  4.3G  29% /mnt<br>[root@gpfs01 ~]# mmlsdisk demo-fs<br>disk         driver   sector     failure holds    holds                            storage<br>name         type       size       group metadata data  status        availability pool<br>------------ -------- ------ ----------- -------- ----- ------------- ------------ ------------<br>nsd02        nsd         512           1 yes      yes   ready         up           system<br>nsd03        nsd         512           1 yes      yes   ready         up           system<br>nsd04        nsd         512           1 yes      yes   ready         up           system<br>[root@gpfs01 ~]# mmlsnsd<br><br> File system   Disk name       NSD servers<br>------------------------------------------------------------------------------<br> demo-fs       nsd02           gpfs01.sys2.local,gpfs02.sys2.local<br> demo-fs       nsd03           gpfs01.sys2.local,gpfs02.sys2.local<br> demo-fs       nsd04           gpfs01.sys2.local,gpfs02.sys2.local<br> (free disk)   nsd01           gpfs01.sys2.local,gpfs02.sys2.local<br> (free disk)   nsd05           gpfs01.sys2.local,gpfs02.sys2.local<br><br>[root@gpfs01 ~]# mmdelnsd nsd05<br>mmdelnsd: Processing disk nsd05<br>mmdelnsd: Propagating the cluster configuration data to all<br>  affected nodes.  This is an asynchronous process.<br>[root@gpfs01 ~]# mmlsnsd<br><br> File system   Disk name       NSD servers<br>------------------------------------------------------------------------------<br> demo-fs       nsd02           gpfs01.sys2.local,gpfs02.sys2.local<br> demo-fs       nsd03           gpfs01.sys2.local,gpfs02.sys2.local<br> demo-fs       nsd04           gpfs01.sys2.local,gpfs02.sys2.local<br> (free disk)   nsd01           gpfs01.sys2.local,gpfs02.sys2.local<br><br>[root@gpfs01 ~]# mmrestripefs demo-fs -b<br>Scanning file system metadata, phase 1: inode0 files<br> 100 % complete on Fri Aug  8 10:21:07 2025<br>Scan completed successfully.<br>Scanning file system metadata, phase 2: block allocation maps<br> 100 % complete on Fri Aug  8 10:21:07 2025<br>Scan completed successfully.<br>Scanning file system metadata, phase 3: reserved thin-provisioning<br>Scan completed successfully.<br>Scanning file system metadata, phase 4: inode allocation map<br> 100 % complete on Fri Aug  8 10:21:07 2025<br>Scan completed successfully.<br>Scanning file system metadata, phase 5: fileset metadata files<br> 100 % complete on Fri Aug  8 10:21:07 2025<br>Scan completed successfully.<br>Scanning user file metadata ...<br> 100.00 % complete on Fri Aug  8 10:21:12 2025  (    133632 inodes with total       1578 MB data processed)<br>Scan completed successfully.<br>[root@gpfs01 ~]# mmlsfs demo-fs<br>flag                value                    description<br>------------------- ------------------------ -----------------------------------<br> -f                 8192                     Minimum fragment (subblock) size in bytes<br> -i                 4096                     Inode size in bytes<br> -I                 16384                    Indirect block size in bytes<br> -m                 1                        Default number of metadata replicas<br> -M                 2                        Maximum number of metadata replicas<br> -r                 1                        Default number of data replicas<br> -R                 2                        Maximum number of data replicas<br> -j                 cluster                  Block allocation type<br> -D                 nfs4                     File locking semantics in effect<br> -k                 nfs4                     ACL semantics in effect<br> -n                 32                       Estimated number of nodes that will mount file system<br> -B                 524288                   Block size<br> -Q                 user;group;fileset       Quotas accounting enabled<br>                    user;group;fileset       Quotas enforced<br>                    none                     Default quotas enabled<br> --perfileset-quota no                       Per-fileset quota enforcement<br> --filesetdf        yes                      Fileset df enabled?<br> -V                 37.00 (5.2.3.0)          File system version<br> --create-time      Wed Jun 25 03:17:38 2025 File system creation time<br> -z                 no                       Is DMAPI enabled?<br> -L                 33554432                 Logfile size<br> -E                 yes                      Exact mtime mount option<br> -S                 relatime                 Suppress atime mount option<br> -K                 whenpossible             Strict replica allocation option<br> --fastea           yes                      Fast external attributes enabled?<br> --encryption       no                       Encryption enabled?<br> --inode-limit      133632                   Maximum number of inodes<br> --uid              A001A8C0:685BA292        File system UID<br> --log-replicas     0                        Number of log replicas<br> --is4KAligned      yes                      is4KAligned?<br> --rapid-repair     yes                      rapidRepair enabled?<br> --write-cache-threshold 0                   HAWC Threshold (max 65536)<br> --subblocks-per-full-block 64               Number of subblocks per full block<br> -P                 system                   Disk storage pools in file system<br> --file-audit-log   no                       File Audit Logging enabled?<br> --maintenance-mode no                       Maintenance Mode enabled?<br> --flush-on-close   no                       flush cache on file close enabled?<br> --auto-inode-limit yes                      Increase maximum number of inodes per inode space automatically?<br> --nfs4-owner-write-acl yes                  NFSv4 implicit owner WRITE_ACL permission enabled?<br> --inode-segment-mgr yes                     Inode Segment Manager enabled?<br> -d                 nsd02;nsd03;nsd04        Disks in file system<br> -A                 yes                      Automatic mount option<br> -o                 none                     Additional mount options<br> -T                 /mnt                     Default mount point<br> --mount-priority   0                        Mount priority<br>[root@gpfs01 ~]# mmdf<br>mmdf: Missing arguments.<br>Usage:<br>  mmdf Device [-d] [-F] [-m] [-P PoolName] [-Y | --block-size {BlockSize | auto}]<br>       [--qos QosClass]<br>[root@gpfs01 ~]# mmdf demo-fs<br>disk                disk size  failure holds    holds           free in KB          free in KB<br>name                    in KB    group metadata data        in full blocks        in fragments<br>--------------- ------------- -------- -------- ----- -------------------- -------------------<br>Disks in storage pool: system (Maximum disk size allowed is 126.00 GB)<br>nsd03                 2097152        1 yes      yes         1497088 ( 71%)          1128 ( 0%)<br>nsd04                 2097152        1 yes      yes         1500160 ( 72%)           888 ( 0%)<br>nsd02                 2097152        1 yes      yes         1498624 ( 71%)          1384 ( 0%)<br>                -------------                         -------------------- -------------------<br>(pool total)          6291456                               4495872 ( 71%)          3400 ( 0%)<br><br>                =============                         ==================== ===================<br>(total)               6291456                               4495872 ( 71%)          3400 ( 0%)<br><br>Inode Information<br>-----------------<br>Number of used inodes:            4038<br>Number of free inodes:          129594<br>Number of allocated inodes:     133632<br>Maximum number of inodes:       133632<br>[root@gpfs01 ~]#</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0641b141f5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux write systemlog with logger]]></title>
            <link>https://medium.com/@zaturdayapril/linux-write-systemlog-with-logger-8daf2d856581?source=rss-97b0203e1685------2</link>
            <guid isPermaLink="false">https://medium.com/p/8daf2d856581</guid>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Voravit Chamchoy]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 02:31:03 GMT</pubDate>
            <atom:updated>2024-10-18T02:31:03.645Z</atom:updated>
            <content:encoded><![CDATA[<p>if you want to tell some message to systemlog, you can can using “logger” to write and able to TAG, piority, MSG or etc</p><p>Detail for other option</p><pre>[mfec@localhost ~]$ logger --help<br><br>Usage:<br> logger [options] [&lt;message&gt;]<br><br>Enter messages into the system log.<br><br>Options:<br> -i                       log the logger command&#39;s PID<br>     --id[=&lt;id&gt;]          log the given &lt;id&gt;, or otherwise the PID<br> -f, --file &lt;file&gt;        log the contents of this file<br> -e, --skip-empty         do not log empty lines when processing files<br>     --no-act             do everything except the write the log<br> -p, --priority &lt;prio&gt;    mark given message with this priority<br>     --octet-count        use rfc6587 octet counting<br>     --prio-prefix        look for a prefix on every line read from stdin<br> -s, --stderr             output message to standard error as well<br> -S, --size &lt;size&gt;        maximum size for a single message<br> -t, --tag &lt;tag&gt;          mark every line with this tag<br> -n, --server &lt;name&gt;      write to this remote syslog server<br> -P, --port &lt;port&gt;        use this port for UDP or TCP connection<br> -T, --tcp                use TCP only<br> -d, --udp                use UDP only<br>     --rfc3164            use the obsolete BSD syslog protocol<br>     --rfc5424[=&lt;snip&gt;]   use the syslog protocol (the default for remote);<br>                            &lt;snip&gt; can be notime, or notq, and/or nohost<br>     --sd-id &lt;id&gt;         rfc5424 structured data ID<br>     --sd-param &lt;data&gt;    rfc5424 structured data name=value<br>     --msgid &lt;msgid&gt;      set rfc5424 message id field<br> -u, --socket &lt;socket&gt;    write to this Unix socket<br>     --socket-errors[=&lt;on|off|auto&gt;]<br>                          print connection errors when using Unix sockets<br>     --journald[=&lt;file&gt;]  write journald entry<br><br> -h, --help               display this help<br> -V, --version            display version<br><br>For more details see logger(1).<br>[mfec@localhost ~]$</pre><p><em>figure in /var/log/messages</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XzzCbTWRfgzTro3AIXSyRA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8daf2d856581" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Red Hat LVM VDO]]></title>
            <link>https://medium.com/@zaturdayapril/red-hat-lvm-vdo-4b1341c5c461?source=rss-97b0203e1685------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b1341c5c461</guid>
            <category><![CDATA[rhel]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Voravit Chamchoy]]></dc:creator>
            <pubDate>Wed, 18 Sep 2024 08:01:59 GMT</pubDate>
            <atom:updated>2024-09-18T08:01:59.608Z</atom:updated>
            <content:encoded><![CDATA[<h4>Create a Logical Volume with Deduplication and Compression</h4><p>RHEL 9 uses an LVM <em>Virtual Data Optimizer (VDO)</em> implementation for managing VDO volumes. The previous Python-based VDO management tools are still available but are no longer needed.</p><p>The VDO provides inline block-level deduplication, compression, and thin provisioning for storage. Configure a VDO volume to use up to 256 TB of physical storage. Manage VDO as a type of LVM logical volume (LVs), similar to LVM thinly provisioned volumes. An LVM VDO is composed of two logical volumes:</p><p>VDO pool LV</p><p>This LV stores, deduplicates, compresses data, and sets the size of the VDO volume that is backed by the physical device. VDO is deduplicated and compresses each VDO LV separately, because each VDO pool LV can hold only one VDO LV.</p><p>VDO LV</p><p>A virtual device is provisioned on top of the VDO pool LV, and sets the logical size of the VDO volume to store the data before deduplication and compression occur.</p><p>LVM VDO presents the deduplicated storage as a regular logical volume (LV). The VDO volume can be formatted with standard file systems, or shared as a block device, or used to build other storage layers, the same as any normal logical volume.</p><p>To use VDO deduplication and compression, install the vdo and kmod-kvdo packages.</p><pre>[root@host ~]# dnf install vdo kmod-kvdo</pre><p>Verify that the selected LVM volume group has enough free storage capacity. Use the lvcreate command with the --type vdo parameter to create a VDO LV.</p><pre>[root@host ~]# lvcreate --type vdo --name vdo-lv01 --size 5G vg01<br>    Logical blocks defaulted to 523108 blocks.<br>    The VDO volume can address 2 GB in 1 data slab.<br>    It can grow to address at most 16 TB of physical storage in 8192 slabs.<br>    If a larger maximum size might be needed, use bigger slabs.<br>  Logical volume &quot;vdo-lv01&quot; created.</pre><h4>Create a File System on the Logical Volume</h4><p>Specify the logical volume by using either the /dev/<em>vgname</em>/<em>lvname</em> traditional name, or the /dev/mapper/<em>vgname-lvname</em> kernel device mapper name.</p><p>Use the mkfs command to create a file system on the new logical volume.</p><pre>[root@host ~]# mkfs -t xfs /dev/vg01/vdo-lv01<br>...output omitted...</pre><p>Create a mount point by using the mkdir command.</p><pre>[root@host ~]# mkdir /mnt/data</pre><p>To make the file system available persistently, add an entry to the /etc/fstab file.</p><pre>/dev/vg01/vdo-lv01 /mnt/data xfs defaults 0 0</pre><p>Mount the LV by using the mount command.</p><pre>[root@host ~]# mount /mnt/data/</pre><h3>Note</h3><p>You can mount a logical volume by name or by UUID, because LVM parses the PVs by looking for the UUID. This behavior is successful even when the VG was created by using a name, because the PV always contains a UUID.</p><h3>Display LVM Component Status</h3><p>LVM provides various utilities to display the status information of PV, VG, and LV. Use the pvdisplay, vgdisplay, and lvdisplay commands to show the status information of the LVM components.</p><p>The associated pvs, vgs, and lvs commands are commonly used and show a subset of the status information, with one line for each entity.</p><h4>Display Physical Volume Information</h4><p>The pvdisplay command displays information about the PVs. Use the command without arguments to list information of all PVs on the system. Providing the name of the PV as the argument to the command shows the information that is specific to the PV.</p><pre>[root@host ~]# pvdisplay /dev/vdb1<br>  --- Physical volume ---<br>  PV Name               /dev/vdb1                         1<br>  VG Name               vg01                              2<br>  PV Size               731.98 MiB / not usable 3.98 MiB  3<br>  Allocatable           yes<br>  PE Size               4.00 MiB                          4<br>  Total PE              182<br>  Free PE               107                               5<br>  Allocated PE          75<br>  PV UUID               zP0gD9-NxTV-Qtoi-yfQD-TGpL-0Yj0-wExh2N</pre><p>PV Name shows the device name.<br>VG Name shows the volume group where the PV is allocated.<br>PV Size shows the physical size of the PV, including unusable space.<br>PE Size shows the physical extent size.<br>Free PE shows the PE size available in the VG to create new LVs or extend existing LVs.</p><h4>Display Volume Group Information</h4><p>The vgdisplay command shows the information about volume groups. To list information about all VGs, use the command without arguments. Provide the name of the VG as an argument to list information that is specific to the VG.</p><pre>[root@host ~]# vgdisplay vg01<br>  --- Volume group ---<br>  VG Name               vg01                1<br>  System ID<br>  Format                lvm2<br>  Metadata Areas        2<br>  Metadata Sequence No  2<br>  VG Access             read/write<br>  VG Status             resizable<br>  MAX LV                0<br>  Cur LV                1<br>  Open LV               1<br>  Max PV                0<br>  Cur PV                2<br>  Act PV                2<br>  VG Size               1012.00 MiB         2<br>  PE Size               4.00 MiB<br>  Total PE              253                 3<br>  Alloc PE / Size       75 / 300.00 MiB<br>  Free  PE / Size       178 / 712.00 MiB    4<br>  VG UUID               jK5M1M-Yvlk-kxU2-bxmS-dNjQ-Bs3L-DRlJNc</pre><p>VG Name shows the name of the volume group.<br>VG Size displays the total size of the storage pool that is available for LV allocation.<br>Total PE shows the total size of PE units.<br>Free PE / Size shows the available space in the VG to create or extend LVs.</p><h4>Display Logical Volume Information</h4><p>The lvdisplay command displays information about logical volumes. Use the command without arguments to list information of all LVs. Providing the name of the LV as an argument displays the information that is specific to the LV.</p><pre>[root@host ~]# lvdisplay /dev/vg01/lv01<br>  --- Logical volume ---<br>  LV Path                /dev/vg01/lv01         1<br>  LV Name                lv01<br>  VG Name                vg01                   2<br>  LV UUID                FVmNel-u25R-dt3p-C5L6-VP2w-QRNP-scqrbq<br>  LV Write Access        read/write<br>  LV Creation host, time servera.lab.example.com, 2022-04-07 10:45:34 -0400<br>  LV Status              available<br>  # open                 1<br>  LV Size                300.00 MiB             3<br>  Current LE             75                     4<br>  Segments               1<br>  Allocation             inherit<br>  Read ahead sectors     auto<br>  - currently set to     8192<br>  Block device           253:0LV Name                lv01<br>  VG Name                vg01</pre><p>LV Path shows the device name of the LV.<br>VG Name shows the VG that is used for creating this LV.<br>LV Size shows the total size of the LV. Use the file-system tools to determine the free and used space for the LV.<br>Current LE shows the number of logical extents that this LV uses.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b1341c5c461" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RedHat autofs]]></title>
            <link>https://medium.com/@zaturdayapril/redhat-autofs-b6fe4abd9bc5?source=rss-97b0203e1685------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6fe4abd9bc5</guid>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Voravit Chamchoy]]></dc:creator>
            <pubDate>Fri, 13 Sep 2024 09:56:31 GMT</pubDate>
            <atom:updated>2024-09-13T09:56:31.667Z</atom:updated>
            <content:encoded><![CDATA[<h3>Automount Network-Attached Storage</h3><h3>Objectives</h3><ul><li>Describe the benefits of using the automounter, and automount NFS exports by using direct and indirect maps.</li></ul><h3>Mount NFS Exports with the Automounter</h3><p>The <em>automounter</em> is a service (autofs) that automatically mounts file systems and NFS exports on demand, and automatically unmounts file systems and NFS exports when the mounted resources are no longer in current use.</p><p>The automounter function was created to solve the problem that unprivileged users do not have sufficient permissions to use the mount command. Without use of the mount command, normal users cannot access removable media such as CDs, DVDs, and removable disk drives. Furthermore, if a local or remote file system is not mounted at boot time by using the /etc/fstab configuration, then a normal user cannot mount and access those unmounted file systems.</p><p>The automounter configuration files are populated with file-system mount information, in a similar way to /etc/fstab entries. Although /etc/fstab file systems mount during system boot and remain mounted until system shutdown or other intervention, automounter file systems do not necessarily mount during system boot. Instead, automounter-controlled file systems mount on demand, when a user or application attempts to enter the file-system mount point to access files.</p><h4>Automounter Benefits</h4><p>Resource use for automounter file systems is equivalent to file systems that are mounted at boot, because a file system uses resources only when a program is reading and writing open files. Mounted but idle file systems and unmounted file systems use almost no resources.</p><p>The automounter advantage is that by unmounting the file system each time that it is no longer in use, the file system is protected from unexpected corruption when it is open. When the file system is directed to mount again, the autofs service uses the most current mount configuration, unlike an /etc/fstab mount, which might still use a configuration that was mounted months ago during the last system boot. Additionally, if your NFS server configuration includes redundant servers and paths, then the automounter can select the fastest connection each time that a new file system is requested.</p><h4>The Automounter autofs Service Method</h4><p>The autofs service supports the same local and remote file systems as in the /etc/fstab file, including NFS and SMB file sharing protocols, and supports the same protocol-specific mount options, including security parameters. File systems that are mounted through the automounter are available by default to all users, but can be restricted through access permission options.</p><p>Because the automounter is a client-side configuration that uses the standard mount and umount commands to manage file systems, automounted file systems in use exhibit the same behavior to file systems that are mounted by using /etc/fstab. The difference is that an automounter file system remains unmounted until the mount point is accessed, which causes the file system to mount immediately, and to remain mounted when the file system is in use. When all files on the file system are closed, and all users and processes leave the mount point directory, the automounter unmounts the file system after a minimal timeout.</p><h4>Direct and Indirect Map Use Cases</h4><p>The automounter supports both direct and indirect mount-point mapping, to handle the two types of demand mounting. A <em>direct</em> mount is when a file system mounts to an unchanging, known mount point location. Almost all the file system mounts that you configured, before learning about the automounter, are examples of direct mounts. A <em>direct</em> mount point exists as a permanent directory, the same as other normal directories.</p><p>An <em>indirect</em> mount is when the mount point location is not known until the mount demand occurs. An example of an indirect mount is the configuration for remote-mounted home directories, where a user’s home directory includes their username in the directory path. The user’s remote file system is mounted to their home directory, only after the automounter learns which user specified to mount their home directory, and determines the mount point location to use. Although <em>indirect</em> mount points appear to exist, the autofs service creates them when the mount demand occurs, and deletes them again when the demand ended and the file system is unmounted.</p><h3>Configure the Automounter Service</h3><p>To use the autofs service, you must install the autofs and nfs-utils packages.</p><pre>[root@host ~]# dnf install autofs nfs-utils</pre><h4>The Master Map File</h4><p>The master map file (/etc/auto.master) is the default configuration file for the autofs service. You can use the /etc/autofs.conf file to change the master map file for the autofs service. Use the /etc/auto.master.d directory to configure the master map file. This file identifies the base directory for mount points, and identifies the mapping file to create the automounts.</p><p>The name of the master map file is mostly arbitrary (although typically meaningful), and it must have an extension of .autofs for the subsystem to recognize it. You can place multiple entries in a single master map file; alternatively, you can create multiple master map files, each with its own logically grouped entries.</p><p>The master map uses the following format for automounting:</p><pre>[root@host ~]# cat /etc/auto.master.d/demo.autofs<br>mount-point     map-file</pre><p>Replace the <em>mount-point</em> variable with the directory to be used as the base mount point for automounts.</p><p>Replace the <em>map-file</em> variable with the file to be used as the map file. The map file must be created before starting the autofs service.</p><h4>The Map File</h4><p>Map files configure the properties of individual on-demand mount points.</p><p>The automounter creates the directories if they do not exist. If the directories already exist before the automounter starts, then the automounter will not remove them when it exits. If a timeout is specified, then the directory is automatically unmounted if the directory is not accessed for the timeout period.</p><p>If you use a single directory name for the mount point, then the directory is mounted as an indirect mount. If you use the full path for the mount point, then the directory is mounted as a direct mount.</p><p>The map file uses the following format for automounting:</p><pre>[root@host ~]# cat /etc/auto.demo<br>mount-point     mount-options     source-location</pre><p>Replace the <em>mount-point</em> variable with the autofs mount point.</p><p>Replace the <em>mount-options</em> variable with the options to be used for mounting the autofs mount point.</p><p>Replace the <em>source-location</em> variable with the source location of the mount.</p><p>Create an Indirect Map File</p><p>Each mapping file identifies the mount point, mount options, and the source location to mount for a set of automounts.</p><p>For indirect automounting, include the following content in the master map file:</p><pre>[root@host ~]# cat /etc/auto.master.d/indirect.autofs<br>/shares  /etc/auto.indirect</pre><p>This entry uses the /shares directory as the base mount point for the indirect automount. The /etc/auto.indirect map file contains the mount details.</p><p>The following example shows a sample entry in the map file:</p><pre>[root@host ~]# cat /etc/auto.indirect<br>work  -rw,sync  hosta:/shares/work</pre><p>The naming convention for a map file is /etc/auto.<em>name</em>, where <em>name</em> reflects the content of the map.</p><p>Known as the <em>key</em> in the man pages, the autofs service automatically creates and removes the mount point. In this case, the fully qualified mount point is /shares/work (see the master map file). The autofs service creates and removes the /shares and /shares/work directories as needed.</p><p>In this example, the local mount point mirrors the server’s directory structure. However, this mirroring is not required; the local mount point can have an arbitrary name. The autofs service does not enforce a specific naming structure on the client.</p><p>Mount options start with a dash character (-) and are comma-separated with no white space. The file-system mount options for manual mounting are also available when automounting. In this example, the automounter mounts the export with read/write access (rw option), and the server is synchronized immediately during write operations (sync option).</p><p>Useful automounter-specific options include -fstype= and -strict. Use fstype to specify the file-system type, for example nfs4 or xfs, and use strict to treat errors when mounting file systems as fatal.</p><p>The source location for NFS exports follows the host:/pathname pattern, in this example hosta:/shares/work. For this automount to succeed, the NFS server, hosta, must <em>export</em> the directory with read/write access, and the user that requests access must have standard Linux file permissions on the directory. If hosta exports the directory with read/only access, then the client gets read/only access even if it requested read/write access.</p><p>Create a Direct Map File</p><p>A direct map file maps an NFS export to an absolute path mount point. Only one direct map file is necessary, and can contain any number of direct maps.</p><p>To use directly mapped mount points, include the following content in the master map file:</p><pre>[root@host ~]# cat /etc/direct.autofs<br>/-  /etc/auto.direct</pre><p>The naming convention for a map file is /etc/auto.<em>name</em>, where <em>name</em> reflects the content of the map.</p><p>All direct map entries use the /- path as the base directory. In this case, the /etc/auto.direct mapping file contains the mount details.</p><p>The following example shows a sample entry in the map file:</p><pre>[root@host ~]# cat /etc/auto.direct<br>/mnt/docs  -rw,sync  hosta:/shares/docs</pre><p>The mount point (or key) is always an absolute path. The rest of the mapping file uses the same structure.</p><p>In this example, the /mnt directory exists, and the autofs service does not manage it. The autofs service creates and removes the full /mnt/docs directory automatically.</p><p>Using Wildcards in Map Files</p><p>When an NFS server exports multiple subdirectories within a directory, then the automounter can be configured to access any of those subdirectories with a single mapping entry.</p><p>Continuing the previous example, if the hosta:/shares export contains two or more subdirectories, and they are accessible with the same mount options, then the entry for the /etc/auto.indirect file might appear as follows:</p><pre>[root@host ~]# cat /etc/auto.indirect<br>*  -rw,sync  hosta:/shares/&amp;</pre><p>The mount point (or key) is an asterisk character (*), and the subdirectory on the source location is an ampersand character (&amp;). Everything else in the entry is the same.</p><p>When a user attempts to access /shares/work, the * key (which is work in this example) replaces the ampersand in the source location and hosta:/shares/work is mounted. As with the indirect map file example, the autofs service creates and removes the work directory automatically.</p><h3>Start the Automounter Service</h3><p>After you have configured the master map and map files, use the systemctl command to start and enable the autofs service.</p><pre>[root@host ~]# systemctl enable --now autofs<br>Created symlink /etc/systemd/system/multi-user.target.wants/autofs.service → /usr/lib/systemd/system/autofs.service.</pre><h3>The Alternative Automount Method</h3><p>The systemd daemon can automatically create unit files for entries in the /etc/fstab file that include the x-systemd.automount option. Use the systemctl daemon-reload command after modifying an entry&#39;s mount options to generate a new unit file. Then use the systemctl start <em>unit</em>.automount command to enable the automount configuration.</p><p>The naming of the unit is based on its mount location. For example, if the mount point is /remote/finance, then the unit file is named remote-finance.automount. The systemd daemon mounts the file system when the /remote/finance directory is initially accessed.</p><p>This method can be simpler than installing and configuring the autofs service. However, a systemd.automount unit can support only absolute path mount points, similar to the autofs direct maps.</p><h3>References</h3><p>autofs(5), automount(8), auto.master(5), mount.nfs(8), and systemd.automount(5) man pages</p><p>For further information, refer to the <em>Mounting File Systems on Demand</em> chapter in the <em>Managing File Systems</em> guide at <a href="https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html-single/managing_file_systems/index#the-autofs-service_mounting-file-systems-on-demand">https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html-single/managing_file_systems/index#the-autofs-service_mounting-file-systems-on-demand</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6fe4abd9bc5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redhat tuned]]></title>
            <link>https://medium.com/@zaturdayapril/redhat-tuned-311e062d0446?source=rss-97b0203e1685------2</link>
            <guid isPermaLink="false">https://medium.com/p/311e062d0446</guid>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Voravit Chamchoy]]></dc:creator>
            <pubDate>Thu, 12 Sep 2024 10:01:25 GMT</pubDate>
            <atom:updated>2024-09-12T10:01:25.816Z</atom:updated>
            <content:encoded><![CDATA[<h3>Adjust Tuning Profiles</h3><h3>Objectives</h3><ul><li>Optimize system performance by selecting a tuning profile that the tuned daemon manages.</li></ul><h3>Tune Systems</h3><p>System administrators optimize the performance of a system by adjusting device settings based on various use case workloads. The tuned daemon applies tuning adjustments both statically and dynamically by using tuning profiles that reflect particular workload requirements.</p><h4>Configure Static Tuning</h4><p>The tuned daemon applies system settings when a service starts or on selecting a new tuning profile. Static tuning configures predefined kernel parameters in profiles that the tuned daemon applies at boot. With static tuning, the tuned daemon sets kernel parameters for overall performance expectations, without adjusting these parameters as activity levels change.</p><h4>Configure Dynamic Tuning</h4><p>With dynamic tuning, the tuned daemon monitors system activity and adjusts settings according to runtime behavior changes. Dynamic tuning continuously adjusts tuning to fit the current workload, starting with the initial declared settings in your selected tuning profile.</p><p>For example, storage devices experience high use during startup and login, but have minimal activity when user workloads consist of using web browsers and email clients. Similarly, CPU and network devices experience activity increases during peak usage throughout a workday. The tuned daemon monitors the activity of these components, and adjusts parameter settings to maximize performance during high-activity times and to reduce settings during low activity. Predefined tuning profiles provide performance parameters that the tuned daemon uses.</p><p>To monitor and adjust parameter settings, the tuned daemon uses modules called monitor and tuning plug-ins, respectively.</p><p>Monitor plug-ins analyze the system and obtain information from it, so the tuning plug-ins use this information for dynamic tuning. At this moment, the tuned daemon ships with three monitor plug-ins:</p><ul><li>disk: Monitors the disk load based on the number of I/O operations for every disk device.</li><li>net: Monitors the network load based on the number of transferred packets per network card.</li><li>load: Monitors the CPU load for every CPU.</li></ul><p>Tuning plug-ins tune the individual subsystems. They use the data from the monitor plug-ins and the performance parameters from the predefined tuning profiles. Among others, the tuned daemon ships with the following tuning plug-ins:</p><ul><li>disk: Sets different disk parameters, for example, the disk scheduler, the spin-down timeout, or the advanced power management.</li><li>net: Configures the interface speed and the Wake-on-LAN (WoL) functionality.</li><li>cpu: Sets different CPU parameters, for example, the CPU governor or the latency.</li></ul><p>By default, dynamic tuning is disabled. You can enable it by setting the dynamic_tuning variable to 1 in the /etc/tuned/tuned-main.conf configuration file. If you enable dynamic tuning, then the tuned daemon periodically monitors the system and adjusts the tuning settings to runtime behavior changes. You can set the time in seconds between updates by using the update_interval variable in the /etc/tuned/tuned-main.conf configuration file.</p><pre>[root@host ~]$ cat /etc/tuned/tuned-main.conf<br>...output omitted...<br># Dynamicaly tune devices, if disabled only static tuning will be used.<br>dynamic_tuning = 1<br>...output omitted...<br># Update interval for dynamic tunings (in seconds).<br># It must be multiply of the sleep_interval.<br>update_interval = 10<br>...output omitted...</pre><h3>The tuned Utility</h3><p>You can install and enable the tuned package by using the following commands:</p><pre>[root@host ~]$ dnf install tuned<br>...output omitted...<br>[root@host ~]$ systemctl enable --now tuned<br>Created symlink /etc/systemd/system/multi-user.target.wants/tuned.service → /usr/lib/systemd/system/tuned.service.</pre><p>The tuned application provides profiles in the following categories:</p><ul><li>Power-saving profiles</li><li>Performance-boosting profiles</li></ul><p>The performance-boosting profiles include profiles that focus on the following aspects:</p><ul><li>Low latency for storage and network</li><li>High throughput for storage and network</li><li>Virtual machine performance</li><li>Virtualization host performance</li></ul><p>The next table shows a list of the tuning profiles that are distributed with Red Hat Enterprise Linux 9:</p><p><strong>Table 5.1. Tuning Profiles Distributed with Red Hat Enterprise Linux 9</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H4miEdE4KEShvr7aESorrg.png" /></figure><p>The tuned application stores the tuning profiles under the /usr/lib/tuned and /etc/tuned directories. Every profile has a separate directory, and inside the directory the tuned.conf main configuration file and, optionally, other files.</p><pre>[root@host ~]# cd /usr/lib/tuned<br>[root@host tuned]# ls<br>accelerator-performance  hpc-compute          network-throughput       throughput-performance<br>balanced                 intel-sst            optimize-serial-console  virtual-guest<br>desktop                  latency-performance  powersave                virtual-host<br>functions                network-latency      recommend.d<br>[root@host tuned]$ ls virtual-guest<br>tuned.conf</pre><p>A typical tuned.conf configuration file looks as follows:</p><pre>[root@host tuned]# cat virtual-guest/tuned.conf<br>#<br># tuned configuration<br>#</pre><pre>[main]<br>summary=Optimize for running inside a virtual guest<br>include=throughput-performance</pre><pre>[sysctl]<br># If a workload mostly uses anonymous memory and it hits this limit, the entire<br># working set is buffered for I/O, and any more write buffering would require<br># swapping, so it&#39;s time to throttle writes until I/O can catch up.  Workloads<br># that mostly use file mappings may be able to use even higher values.<br>#<br># The generator of dirty data starts writeback at this percentage (system default<br># is 20%)<br>vm.dirty_ratio = 30</pre><pre># Filesystem I/O is usually much more efficient than swapping, so try to keep<br># swapping low.  It&#39;s usually safe to go even lower than this on systems with<br># server-grade storage.<br>vm.swappiness = 30</pre><p>The [main] section in the file might include a summary of the tuning profile. This section also accepts the include parameter, for the profile to inherit all the settings from the referenced profile.</p><p>This configuration file is useful when creating new tuning profiles, because you can use one of the provided profiles as a basis, and then add or modify the parameters to configure. To create or modify tuning profiles, copy the tuning profile files from the /usr/lib/tuned directory to the /etc/tuned directory and then modify them. If profile directories exist with the same name under the /usr/lib/tuned and /etc/tuned directories, the latter always take precedence. Thus, never directly modify files in the /usr/lib/tuned system directory.</p><p>The rest of the sections in the tuned.conf file use the tuning plug-ins to modify parameters in the system. In the previous example, the [sysctl] section modifies the vm.dirty_ratio and vm.swappiness kernel parameters through the sysctl plug-in.</p><h3>Manage Profiles from the Command Line</h3><p>Use the tuned-adm command to change the settings of the tuned daemon. The tuned-adm command queries current settings, lists available profiles, recommends a tuning profile for the system, changes profiles directly, or turns off tuning.</p><p>You can identify the currently active tuning profile with the tuned-adm active command.</p><pre>[root@host ~]# tuned-adm active<br>Current active profile: virtual-guest</pre><p>The tuned-adm list command lists all available tuning profiles, including both built-in profiles and the custom-created tuning profiles.</p><pre>[root@host ~]# tuned-adm list<br>Available profiles:<br>- accelerator-performance     - Throughput performance based tuning with ...<br>- balanced                    - General non-specialized tuned profile<br>- desktop                     - Optimize for the desktop use-case<br>- hpc-compute                 - Optimize for HPC compute workloads<br>- intel-sst                   - Configure for Intel Speed Select Base Frequency<br>- latency-performance         - Optimize for deterministic performance at ...<br>- network-latency             - Optimize for deterministic performance at ...<br>...output omitted...<br>Current active profile: virtual-guest</pre><p>Use the tuned-adm profile_info command for information about a given profile.</p><pre>[root@host ~]$ tuned-adm profile_info network-latency<br>Profile name:<br>network-latency</pre><pre>Profile summary:<br>Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance<br>...output omitted..</pre><p>If no profile is specified, then the tuned-adm profile_info command shows the information for the active tuning profile:</p><pre>[root@host ~]$ tuned-adm active<br>Current active profile: virtual-guest<br>[root@host ~]$ tuned-adm profile_info<br>Profile name:<br>virtual-guest</pre><pre>Profile summary:<br>Optimize for running inside a virtual guest<br>...output omitted..</pre><p>Use the tuned-adm profile <em>profilename</em> command to switch to a different active profile that better matches the system&#39;s current tuning requirements.</p><pre>[root@host ~]$ tuned-adm profile throughput-performance<br>[root@host ~]$ tuned-adm active<br>Current active profile: throughput-performance</pre><p>The tuned-adm recommend command can recommend a tuning profile for the system. The system uses this mechanism to determine the default profile after its installation.</p><pre>[root@host ~]$ tuned-adm recommend<br>virtual-guest</pre><h3>Note</h3><p>The tuned-adm recommend command bases its recommendation on various system characteristics, including whether the system is a virtual machine and other predefined selected categories during system installation.</p><p>To revert the setting changes that the current profile applied, either switch to another profile or deactivate the tuned daemon. Turn off the tuned application tuning activity by using the tuned-adm off command.</p><pre>[root@host ~]$ tuned-adm off<br>[root@host ~]$ tuned-adm active<br>No current active profile.</pre><h3>Manage Profiles with the Web Console</h3><p>To manage system performance profiles with the web console, you must log in and escalate privileges. Privilege escalation mode permits the user to execute commands, with administrative privileges, that modify system performance profiles. Because changing tuning profiles modifies some system parameters, you must do it with administrative privileges.</p><p>You can switch to the administrative access mode in the web console by clicking the Limited access or the Turn on administrative access buttons. Then, enter your password when prompted. After you escalate privileges, the Limited access button changes to Administrative access. As a security reminder, always toggle back to limited access mode after completing the system task that requires administrative privileges.</p><p>As a privileged user, click the Overview menu option in the left navigation bar. The Performance profile field displays the current active profile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Da4YaR7JuWlvCiQY.png" /></figure><p>Figure 5.1: Active performance profile</p><p>To select a different profile, click the active profile link. In the Change performance profile user interface, scroll through the profile list to select one that best suits the system purpose, and click the Change profile button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/0*Vh7yqFW0WGco8jlY.png" /></figure><p>Figure 5.2: Select a preferred performance profile</p><p>To verify changes, return to the main Overview page, and confirm that it displays the active profile in the Performance profile field.</p><h3>Influence Process Scheduling</h3><h3>Objectives</h3><ul><li>Prioritize or deprioritize specific processes, with the nice and renice commands.</li></ul><h3>Linux Process Scheduling</h3><p>Modern computer systems use multi-core, multi-thread CPUs that can execute many instruction threads simultaneously. The largest high-performing supercomputers can have hundreds or thousands of CPUs with hundreds of processing cores and thread structures per CPU, and can process millions of instruction threads in parallel. Although a single user who runs many applications can saturate the typical desktop system or personal workstation with CPU activity, a correctly sized and configured workstation is designed to match the user’s intended workload. However, the typical enterprise or internet server handles many hundreds or thousands of users and application requests each second, which can result in CPU saturation. All systems under CPU load experience scenarios that require handling more process threads than the available system CPU processing units to schedule the threads immediately.</p><p>Linux and other operating systems use a technique called <em>time-slicing</em> or <em>multitasking</em> for process management. The operating system <em>process scheduler</em> rapidly switches between process threads on each available CPU core. This behavior gives the impression that many processes are running at the same time.</p><h4>Process Priorities</h4><p>Process <em>priority</em> sets the importance of each process. Linux implements <em>scheduling policies</em> that define the rules by which processes are organized and prioritized to obtain CPU processing time. The various Linux scheduling policies might be designed to handle interactive application requests, or non-interactive batch application processing, or real-time application requirements. Real-time scheduling policies still use process priorities and queues. However, current, non-real-time (<em>normal</em>) scheduling policies use the Completely Fair Scheduler (CFS), which instead organizes processes that are awaiting CPU time into a binary search tree. This process priority uses the SCHED_NORMAL or SCHED_OTHER policies as the default scheduling policy.</p><p>Processes that run under the SCHED_NORMAL policy are assigned a <em>static</em> real-time priority of 0, to ensure that all system real-time processes have a higher priority than normal processes. However, this static priority value is not included when organizing normal process threads for CPU scheduling. Instead, the CFS scheduling algorithm arranges normal process threads into a time-weighted binary tree, where the first item has the lowest previously spent CPU time, and the last item has the most cumulative CPU time.</p><h4>Nice Value</h4><p>The order of the binary tree is additionally influenced by a user-modifiable, per-process <em>nice</em> value, which ranges from -20 (increased priority) to 19 (decreased priority), with a default of 0. Processes inherit their starting nice value from their parent process. All users can adjust the nice value to decrease priority, but only root can increase its priority.</p><p>A higher nice value indicates a decrease in the process priority from the default, or <em>making the process nicer</em> to other processes. A lower nice value indicates an increase in the process priority from the default, or <em>making the process less nice</em> to other processes.</p><p>Increasing the nice value lowers the thread’s position, and decreasing the value raises the thread’s position.</p><h3>Important</h3><p>Generally, priorities determine only indirectly the amount of CPU time that a process thread receives. On a non-saturated system with available CPU capacity, every process is scheduled for immediate CPU time, for as much time as each process wants. Relative process importance, as managed in the binary tree, determines only which threads are selected and placed on CPUs first.</p><p>On a CPU-saturated system, where more waiting threads than CPU processing units exist, higher-priority (lower nice) process threads are placed first, until all CPU units are busy, while the lower-priority (higher nice) threads initially must wait in the binary tree. However, the Completely Fair Scheduler is designed to balance process importance, nice values, and previous cumulative CPU time, and dynamically adjusts the binary tree such that all processes obtain fair CPU time.</p><h4>Permission to Modify Nice Values</h4><p>Privileged users can decrease the nice value of a process, to make a process less nice. A process is then repetitively placed higher in the binary tree, and therefore is scheduled more often. On a saturated system, the overall CPU time available to other processes is reduced.</p><p>Unprivileged users can only increase the nice value on their own processes, which makes their own processes nicer, and therefore lowers their placement in the binary tree. Unprivileged users cannot decrease their processes’ nice values to raise their importance, nor can they adjust the nice values for another user’s process.</p><h4>Viewing Nice Values</h4><p>Nice values map to a priority value, and both values are available for viewing in process listing commands. A nice value of -20 maps to a 0 priority in the top command. A nice value of 19 maps to a 39 priority in the top command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2051HN9acWM0f31DLeLBPQ.png" /></figure><p>Figure 5.3: Priorities and nice values as reported by the top command</p><p>In the preceding figure, the nice values are aligned with the priority values that are used by the top command. The top command displays the process priority in the PR column, and the nice value in the NI column. The top priority numbering scheme, which displays real-time process priorities as negative numbers, is a legacy of internal priority algorithms.</p><p>The following output is the summary and a partial process listing in the top command:</p><pre>Tasks: 192 total,   1 running, 191 sleeping,   0 stopped,   0 zombie<br>%Cpu(s):  0.0 us,  1.6 sy,  0.0 ni, 96.9 id,  0.0 wa,  0.0 hi,  1.6 si,  0.0 st<br>MiB Mem :   5668.6 total,   4655.6 free,    470.1 used,    542.9 buff/cache<br>MiB Swap:      0.0 total,      0.0 free,      0.0 used.   4942.6 avail Mem</pre><pre>    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND<br>      1 root      20   0  172180  16232  10328 S   0.0   0.3   0:01.49 systemd<br>      2 root      20   0       0      0      0 S   0.0   0.0   0:00.01 kthreadd<br>      3 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_gp<br>      4 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_par_gp</pre><p>The ps command displays process nice values, when using the default formatting options.</p><p>The following ps command lists all processes with their process ID, process name, nice value, and scheduling class. The processes are sorted in descending order by nice value. In the CLS scheduling class column, TS stands for <em>time sharing</em>, which is another name for the normal scheduling policies, including SCHED_NORMAL. Other CLS values, such as FF for <em>first in first out</em> and RR for <em>round robin</em>, indicate real-time processes. Real-time processes are not assigned nice values, as indicated by the dash (-) in the NI column. Advanced scheduling policies are taught in the <em>Red Hat Performance Tuning: Linux in Physical, Virtual, and Cloud (RH442)</em> course.</p><pre>[user@host ~]$ ps axo pid,comm,nice,cls --sort=-nice<br>  PID COMMAND          NI CLS<br>   33 khugepaged       19  TS<br>   32 ksmd              5  TS<br>  814 rtkit-daemon      1  TS<br>    1 systemd           0  TS<br>    2 kthreadd          0  TS<br>    5 kworker/0:0-cgr   0  TS<br>    7 kworker/0:1-rcu   0  TS<br>    8 kworker/u4:0-ev   0  TS<br>   15 migration/0       -  FF<br>...output omitted...</pre><h3>Start Processes with User-set Nice Values</h3><p>When a process is created, it inherits its parent’s nice value. When a process starts from the command line, it inherits its nice value from the shell process. Typically, new processes run with the default nice value of 0.</p><p>The following example starts a process from the shell, and displays the process’s nice value. Note the use of the PID option in the ps command to specify the requested output.</p><h3>Note</h3><p>This command was chosen for demonstration for its low resource consumption.</p><pre>[user@host ~]$ sleep 60 &amp;<br>[1] 2667<br>[user@host ~]$ ps -o pid,comm,nice 2667<br>  PID COMMAND          NI<br> 2667 sleep            0</pre><p>All users can use the nice command to start commands with a default or higher nice value. Setting a higher value by default ensures that the new process is a lower priority than your current working shell, and would less likely affect your current interactive session.</p><p>The following example starts the same command as a background job with the default nice value, and displays the process’s nice value:</p><pre>[user@host ~]$ nice sleep 60 &amp;<br>[1] 2736<br>[user@host ~]$ ps -o pid,comm,nice 2736<br>  PID COMMAND          NI<br> 2736 sleep            10</pre><p>Use the nice command -n option to apply a user-defined nice value to the starting process. The default is to add 10 to the process&#39;s current nice value. The following example starts a background job with a user-defined nice value of 15 and displays the result:</p><pre>[user@host ~]$ nice -n 15 sleep 60 &amp;<br>[1] 2673<br>[user@host ~]$ ps -o pid,comm,nice 2740<br>  PID COMMAND          NI<br> 2740 sleep            15</pre><h4>Change the Nice Value of an Existing Process</h4><p>You can change the nice value of an existing process with the renice command. This example uses the process ID from the previous example to change from the current nice value of 15 to a new nice value of 19.</p><pre>[user@host ~]$ renice -n 19 2740<br>2740 (process ID) old priority 15, new priority 19</pre><p>You can also use the top command to change the nice value on an existing process. From the top interactive interface, press the <strong>r</strong> key to access the renice command. Enter the process ID, and then enter the new nice value.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=311e062d0446" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>