<?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 Osama Elswah on Medium]]></title>
        <description><![CDATA[Stories by Osama Elswah on Medium]]></description>
        <link>https://medium.com/@osama.ibrahim.89?source=rss-236e6d865cae------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*s9p_YiDqq5tzlSGP</url>
            <title>Stories by Osama Elswah on Medium</title>
            <link>https://medium.com/@osama.ibrahim.89?source=rss-236e6d865cae------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 09:14:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@osama.ibrahim.89/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[Escaping the Infinite NFSv4 Grace Period]]></title>
            <link>https://medium.com/@osama.ibrahim.89/escaping-the-infinite-nfsv4-grace-period-133dc9fe0318?source=rss-236e6d865cae------2</link>
            <guid isPermaLink="false">https://medium.com/p/133dc9fe0318</guid>
            <category><![CDATA[software-defined-storage]]></category>
            <category><![CDATA[ceph]]></category>
            <category><![CDATA[openstack]]></category>
            <category><![CDATA[cloud-infrastructure]]></category>
            <category><![CDATA[nfs-server]]></category>
            <dc:creator><![CDATA[Osama Elswah]]></dc:creator>
            <pubDate>Sat, 09 May 2026 22:14:24 GMT</pubDate>
            <atom:updated>2026-05-09T22:14:24.467Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*izZ4MOtXU93bey7MQ6hqJA.jpeg" /></figure><p>Every infrastructure engineer knows the feeling: the post-upgrade calm that is just a little <em>too</em> quiet.</p><p>It started as a standard morning maintenance window. I was upgrading our production Ceph cluster from 19.2.3 to 20.2.1. By all standard metrics, it was a textbook success. The dashboards were entirely green. The VMs backing their storage via RBD were perfectly reachable, and a quick fio benchmark showed performance was exactly where it needed to be.</p><p>I was just about to close the maintenance window when the first ticket came in: <strong>“The NFS shares are down.”</strong></p><p>In our architecture, we use CephFS exposed to customers through NFS-Ganesha gateways. The symptom was bizarre. Clients could attempt to list directories, but the terminal would just hang indefinitely. No timeouts, no connection refused — just an endless freeze.</p><p>The Ceph orchestrator reported all NFS daemons were healthy. The network showed no dropped packets. The dashboard was lying. It was time to dig deeper.</p><h3>Isolating the Fault Domain</h3><p>Before falling down a rabbit hole, I needed to divide the architecture and isolate the fault domain. Was the underlying CephFS file system broken, or was the issue sitting strictly at the NFS gateway layer?</p><p>To test this, I bypassed the NFS gateways entirely. I took a test client and mounted the shares directly using the native CephFS kernel module.</p><p>The native mounts worked flawlessly. Files were accessible, read/write speeds were great, and there were no hangs. This confirmed the CephFS backend was perfectly healthy. The problem was isolated entirely to the NFS-Ganesha daemons.</p><h3>The Smoking Gun: Packet Analysis</h3><p>Now that I knew <em>where</em> to look, I needed to know <em>what</em> was failing. I fired up tcpdump between a hanging client and the Ceph NFS gateway and caught this exchange:</p><p>NFS request xid ... getattr fh 0,2/53 NFS reply xid ... reply ok 96 getattr ERROR: unk 10013</p><p>The client was asking for file attributes (getattr), and the server was immediately rejecting it with error code <strong>10013</strong>.</p><p>In the NFSv4 protocol, 10013 translates to NFS4ERR_GRACE.</p><p>When an NFSv4 server reboots, it enters a “Recovery Grace Period.” During this window, it temporarily rejects new file access requests to give existing clients time to reclaim their previous locks. But a grace period is supposed to last 90 seconds. Ours was lasting forever.</p><h3>The Root Cause: Distributed State</h3><p>Because Ceph is highly available, NFS-Ganesha daemons coordinate their grace periods using a shared database stored inside a RADOS pool.</p><p>When the upgrade from 19.2.3 to 20.2.1 rolled through, the NFS daemons were restarted. However, a phantom record of the <em>old</em> daemons remained stuck in the RADOS database, flagged as needing a grace period (N).</p><p>The newly upgraded daemons booted up, checked the RADOS state, and essentially said: <em>“We cannot end the grace period until those old nodes check in.”</em> Because those old nodes no longer existed, the cluster was deadlocked in a permanent grace period.</p><h3>The Surgical Fix</h3><p>Fixing this required interacting directly with the RADOS grace database, but because Ceph containerizes its daemons with strict least-privilege keyrings, I couldn’t just run the command from the host.</p><p>Here is how we broke the deadlock:</p><p><strong>1. Entering the Container Shell</strong> I used cephadm to drop into the specific, isolated container of the active NFS daemon.</p><p><strong>2. Parsing the Credentials</strong> I extracted the specific RADOS pool (.nfs), namespace (cephnfs), and User ID from the daemon&#39;s ganesha.conf.</p><p><strong>3. Auditing the Database</strong> Running the internal Ganesha tool, I queried the cluster state: ganesha-rados-grace -p .nfs -n cephnfs -u &lt;UserId&gt; dump</p><p>The output revealed the ghost nodes holding the N (Needs Grace) flag, forcing the active nodes into an E (Enforcing) state.</p><p><strong>4. Lifting the Blockade</strong> I issued the command to forcibly clear the database: ganesha-rados-grace -p .nfs -n cephnfs -u &lt;UserId&gt; lift</p><p>I ran dump one last time. The flags were gone.</p><p>Instantly, across the environment, the hanging client terminals unfroze. The queued getattr requests succeeded, and data started flowing again.</p><h3>The Takeaway</h3><p>A green dashboard only tells you that the services are running; it doesn’t tell you what they are thinking.</p><p>Upgrading distributed systems often introduces edge cases where state outlives the daemons themselves. Knowing how to isolate a fault domain, drop down to the packet level, translate a protocol error (10013), and surgically clear a distributed lock is what separates following a runbook from true infrastructure engineering.</p><p>Has anyone else run into infinite grace periods or ghost states during a major storage upgrade? I’d love to hear your debugging war stories in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=133dc9fe0318" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How an Intel E810 driver bug forced a daily reboot of a Ceph Cluster]]></title>
            <link>https://medium.com/@osama.ibrahim.89/how-an-intel-e810-driver-bug-forced-a-daily-reboot-of-a-ceph-cluster-ee3e8d83336e?source=rss-236e6d865cae------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee3e8d83336e</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ceph]]></category>
            <category><![CDATA[kernel]]></category>
            <category><![CDATA[openstack]]></category>
            <category><![CDATA[intel]]></category>
            <dc:creator><![CDATA[Osama Elswah]]></dc:creator>
            <pubDate>Sat, 07 Feb 2026 09:36:54 GMT</pubDate>
            <atom:updated>2026-02-07T09:36:54.103Z</atom:updated>
            <content:encoded><![CDATA[<p>A harmless update can make you question your sanity. That is exactly what happened to me August 2025.</p><p>For the last six months, my team has been fighting a ghost in our Ceph cluster. We spent 180 days performing rolling reboots on our storage nodes. Today, February 6th, 2026, marks the first time in half a year that our cluster has stayed stable for 48 hours without intervention.</p><p>Here is the story of the “Dark Memory” leak, CVE-2025–39948, and how we survived it.</p><h3>The Setup: A Tale of Two Servers</h3><p>Last August (2025), we decided to perform a routine maintenance upgrade on our Ceph OSD cluster running on Ubuntu 24.04 LTS Servers.</p><p>Our cluster hardware is heterogeneous, which turned out to be a critical detail, we have two types of servers:</p><ul><li><strong>Dell R760s with </strong>Broadcom Network Interfaces.</li><li><strong>Dell R750s with </strong>Intel E810 Network Interfaces.</li></ul><h3>The Incident: The Silent OOM</h3><p>Exactly 24 hours after the upgrade, I woke up to a total outage.</p><p>Monitoring was red. The Dell R750s were completely unreachable via SSH. No ping, no response. We logged into the iDRACs and saw the console flooded with OOM (Out of Memory) Killer messages. The system memory was completely exhausted.</p><p>We forced a reboot via iDRAC. The servers came back, Ceph recovered, and everything looked green. We assumed it was a fluke — perhaps a heavy rebalancing operation gone wrong.</p><p>24 hours later, it happened again.</p><h3>The Investigation:</h3><p>As a Ceph admin, your first instinct is to reconfigure Ceph. We went through the standard troubleshooting playbook, convinced that the OSDs were eating the RAM:</p><ol><li><strong>Ceph Version:</strong> Updated to the absolute latest stable release. <em>Result: RAM still filling linearly</em></li><li><strong>NUMA Tuning:</strong> Added specific NUMA configurations to pin OSDs. <em>Result: RAM still filling linearly</em></li><li><strong>Memory Targets:</strong> We aggressively decreased the osd_memory_target. <em>Result: RAM still filling linearly</em></li></ol><p>But when Ceph didn’t seem to be the issue, my eyes went to the hardware and kernel:</p><ol><li><strong>Kernel Swap:</strong> We tried updating to Kernel 6.14, hoping a newer intermediate kernel would fix it. <em>Result: RAM still filling linearly</em></li><li><strong>Firmware:</strong> I updated to the latest available Firmware and hardware drivers. <em>Result: RAM still filling linearly</em></li></ol><p>My brain was starting to boil</p><h3>The “Dark Memory” Phenomenon</h3><p>The most maddening part was the math.</p><p>I started increasing the monitoring for the Ceph Servers, we would sum up the RAM used by every running process (Ceph OSDs, system services, monitoring agents). It never exceeded 9<strong>0 GB.</strong></p><p>Yet, free reported that the server was using <strong>170 GB+ </strong>just within 24 hours of the last reboot.</p><p>There was 80 GB of RAM simply missing. It wasn’t in the cache. It wasn’t in the buffers. It was being consumed by the kernel itself, invisible to standard process monitoring tools.</p><h3>The Breakthrough: The Intel E810 &amp; Kernel 6.8</h3><p>After weeks of debugging, I stumbled upon a thread in the <a href="https://forum.proxmox.com/threads/slow-memory-leak-in-6-8-12-13-pve.168961/">Proxmox Support Forum</a>.</p><p>I wasn’t alone. Others were seeing massive memory leaks on <strong>Kernel 6.8 and 6.14</strong>. The common denominator? The <strong>Intel E810 (ice driver)</strong> networking cards when configured to use Jumbo Frames.</p><p>We eventually tracked this to <strong>CVE-2025–39948</strong>. It was a regression in the kernel networking stack specifically affecting how the E810 driver handled memory pages.</p><h3>The Long Grind</h3><p>We had a diagnosis, but we didn’t have a cure.</p><p>The fix was slated for <strong>Kernel 6.17</strong>. In August 2025, Kernel 6.17 was a distant dream for Ubuntu 24.04 LTS, scheduled for release in February 2026. We checked the Ubuntu security tracker daily, but there was no indication of a backport (as of the day of this writing the fix wasn’t backported to kernel 6.8)</p><p>We were left with one choice: For six months, We restarted the Ceph Cluster every 24 hours, we rebooted the R750 nodes one by one to flush the memory before the OOM killer could strike.</p><h3>The Resolution</h3><p>Two days ago, the wait ended. Ubuntu released the <strong>6.17 HWE (Hardware Enablement) Kernel</strong>.</p><p>We immediately patched the R750s. I watched the Monitoring memory graphs like a hawk.</p><ul><li><strong>12 Hours:</strong> Slow increase of memory usage (normal cache filling), but much slower than the leak on kernels 6.8 and 6.14.</li><li><strong>24 Hours:</strong> Usage stabilizing.</li><li><strong>48 Hours:</strong> Memory usage flat.</li></ul><p>The leak is gone. The ghost has been exorcised.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*La8W6J4QDprsFo2ehj3ODg.png" /></figure><h3>Lessons Learned</h3><ol><li><strong>Memory isn’t just Processes:</strong> When the math doesn’t add up. If process memory is low but used memory is high, the kernel is the culprit.</li><li><strong>Community is King:</strong> If you are facing a weird bug, check the forums of related distros (like Proxmox). Someone else has likely already bled for that knowledge.</li><li><strong>Ceph is rock solid: </strong>Our Ceph cluster survived a daily reboot for 6 months, without outages</li><li><strong>A good team is everything:</strong> My team managed to reboot the servers daily for 6 months, without skipping a day. That is a lot of discipline and a team which shows 100% ownership and responsibility</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee3e8d83336e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Silent Drop: Troubleshooting IPVS Direct Routing on OpenStack ML2/OVN]]></title>
            <link>https://medium.com/@osama.ibrahim.89/the-silent-drop-troubleshooting-ipvs-direct-routing-on-openstack-ml2-ovn-f15afc0d573b?source=rss-236e6d865cae------2</link>
            <guid isPermaLink="false">https://medium.com/p/f15afc0d573b</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[sdn-nfv]]></category>
            <category><![CDATA[openstack-private-cloud]]></category>
            <category><![CDATA[openstack]]></category>
            <dc:creator><![CDATA[Osama Elswah]]></dc:creator>
            <pubDate>Tue, 27 Jan 2026 23:37:31 GMT</pubDate>
            <atom:updated>2026-01-27T23:37:31.769Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are a seasoned Linux system administrator, then you must have configured IPVS (IP Virtual Server) before. One of the modes supported by IPVS is <strong>Direct Routing (DR). </strong>By allowing backend servers to respond directly to clients, you remove the load balancer as the bottleneck for outbound traffic.</p><p>But deploying DR mode in a virtualized cloud environment like OpenStack with ML2/OVN can lead to a maddening scenario: <strong>The TCP connection is established, but the request hangs indefinitely.</strong></p><p>This post details a real-world troubleshooting journey, the “aha!” moment provided by tcpdump, and why stateful cloud networking is often the invisible antagonist in L4 load balancing.</p><h3>The Setup</h3><p>The architecture is standard IPVS DR:</p><ul><li><strong>Load Balancer (Director):</strong> Receives traffic on a Virtual IP (VIP).</li><li><strong>Real Servers (RS):</strong> The backend web servers.</li><li><strong>The Mechanism:</strong> All servers are on the same L2 subnet. The Director receives the packet, changes the <em>destination MAC address</em> to the Real Server’s MAC, and puts it back on the wire. The Real Server processes it and responds <em>directly</em> to the client, using the VIP as the source IP.</li></ul><p>On the Linux side, everything was configured correctly:</p><ol><li>IP forwarding enabled on the Director.</li><li>VIP configured on the Real Server’s loopback interface (lo).</li><li>ARP announcements silenced on the Real Server via sysctl (arp_ignore=1, arp_announce=2) so it wouldn&#39;t &quot;steal&quot; the VIP.</li><li>The Real server is not an OpenStack VM</li></ol><h3>The Symptom</h3><p>We attempt a simple curl to the VIP.</p><p>Bash</p><pre>curl -v http://10.10.10.224<br>* Trying 10.10.10.224:80...<br>* Connected to 10.10.10.224 (10.10.10.224) port 80 (#0)<br>&gt; GET / HTTP/1.1<br>&gt; Host: 10.10.10.224<br>&gt; ...<br>(HANGS HERE FOREVER)</pre><p>The Connected message means the TCP 3-way handshake completed. But no data ever flows. Why? (here started my sleepless night)</p><h3>The Investigation</h3><p>I started by verifying the usual suspects: firewalls on the RS, web server listening configurations, and ARP settings. All checked out.</p><p>The breakthrough came from running simultaneous tcpdump sessions on both the Load Balancer and the Real Server during a connection attempt.</p><h4>View from the Real Server</h4><p>I captured on the RS interface (ens3). I saw the incoming SYN packet from the LB, and crucially, <strong>I saw the outgoing SYN-ACK response.</strong></p><pre># On the Real Server<br>... In  IP Client_IP &gt; VIP: Flags [S] ... (SYN arrives)<br>... Out IP VIP &gt; Client_IP: Flags [S.] ... (SYN-ACK leaves)</pre><p>The Linux kernel on the Real Server was doing its job perfectly.</p><p>The SYN-ACK arrives at the client, the client sends the ACK, and the first HTTP Packet. However the HTTP Packet never reaches the director nor the RS. → My eyes were getting wider …</p><h3>The Root Cause: The “Stateful” Cloud Trap</h3><p>If the Client sent the packet, but the Load Balancer and the RS never saw it, the infrastructure (the OpenStack OVN Hypervisor switch or the FW) swallowed the packet, but as the FW allowed the first packet then, it can’t be the problem.</p><p>And that is when I started looking for ML2/OVN bugs online. And then I found out the “Why”</p><p>Because standard cloud security groups are <strong>stateful</strong>.</p><ul><li>The inbound SYN packet went through the Load Balancer’s port. The SDN tracked this connection state <em>there</em></li><li>The outbound SYN-ACK packet left the RS to the client</li><li>The security group looked at the client HTTP Get Packet, and didn’t recognize the TCP Stream</li><li>It marked the packet as INVALID state and dropped it silently</li></ul><p>Even disabling “Port Security” didn’t help, as the flows were being tracked, the only help was stateless security groups. The Visual Diagram</p><p>Here is a visualization of the traffic flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3XbUDoQVHJwu4UM5jd5l2A.jpeg" /></figure><h3>The Solution: Stateless Security and Allowed Address Pairs</h3><p>To fix this in OpenStack ML2/OVN, I must instruct the SDN infrastructure to allow this “asymmetric” traffic pattern. we have to do:</p><h4>Step 1: Stateless Security Groups</h4><p>Newer versions of OpenStack support “stateless” security groups. These act like traditional router ACLs — they check IP/port rules but do not track connection state (conntrack), allowing the orphaned SYN-ACK to pass.</p><pre># Create a stateless security group<br>openstack security group create --stateless rs-dr-mode<br># Add a rule allowing outbound HTTP from port 80 (or all traffic)<br>openstack security group rule create --egress --protocol tcp --src-port 80 rs-dr-mode<br># Assign it to the load balancer port<br>openstack port set --security-group rs-dr-mode &lt;LB_PORT_ID&gt;</pre><h4>Step 2: Allowed Address Pairs</h4><p>You must explicitly add the VIP to the “Allowed Address Pairs” of the Load balancer</p><pre># Tell OpenStack this port can use the VIP<br>openstack port set --allowed-address ip-address=&lt;VIP_ADDRESS&gt; &lt;LOAD_BALANCER_PORT_ID&gt;<br><br># Tell OpenStack where the clients are coming from<br>openstack port set --allowed-address ip-address=&lt;VIP_ADDRESS&gt; &lt;LOAD_BALANCER_PORT_ID&gt;</pre><p>Once I applied these changes, the OVN switch stopped dropping the return packets, the curl command completed successfully, and our high-performance IPVS DR setup was fully operational.</p><p>What I can’t understand is why I needed to add the client IPs to the allowed address lists of the load balancer, I am not sure if this is a bug or a feature. but if it is a feature, I don’t like it</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f15afc0d573b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to quickly create a local VM for test purposes]]></title>
            <link>https://medium.com/@osama.ibrahim.89/how-to-quickly-create-a-local-ubuntu-vm-for-test-pruposes-25e768b78de1?source=rss-236e6d865cae------2</link>
            <guid isPermaLink="false">https://medium.com/p/25e768b78de1</guid>
            <category><![CDATA[kvm-qemu]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[libvirt]]></category>
            <dc:creator><![CDATA[Osama Elswah]]></dc:creator>
            <pubDate>Fri, 09 Jan 2026 22:15:09 GMT</pubDate>
            <atom:updated>2026-01-09T22:15:35.087Z</atom:updated>
            <content:encoded><![CDATA[<p>As System-Admin I usually need to start a Virtual Machine to test something quickly without the need for extra tools such as VirtualBox. I just want to use Libvirt and qemu.</p><p>For starters you need to download the cloud image. I went for Ubuntu 24.04 cloud image, which can be found here: <a href="https://cloud-images.ubuntu.com/">https://cloud-images.ubuntu.com/</a> <br>Then I would just use curl:</p><pre>curl https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img -o /var/lib/libvirt/images/noble-server-cloudimg-amd64.img</pre><p>We will create a user data file “userdata” and insert following content</p><pre>#cloud-config<br>chpasswd:<br>  list: |<br>    root:x<br>  expire: False</pre><p>Then we will create a meta data file “metadata” and inset following content</p><pre>local-hostname: MyUbuntuVM</pre><p>Then with the following command, you can create the Virtual Machine</p><pre>virt-install --connect qemu:///system \<br>&gt; --virt-type kvm --name MyUbuntuVM \<br>&gt; --ram 4096 \<br>&gt; --vcpus=4 \<br>&gt; --os-variant ubuntu24.04 \<br>&gt; --disk path=/var/lib/libvirt/images/noble-server-cloudimg-amd64.img,format=qcow2,format=qcow2 \<br>&gt; --import \<br>&gt; --cloud-init user-data=/tmp/userdata,meta-data=/tmp/metadata \<br>&gt; --network bridge=virbr1 </pre><p>This command will create the Virtual Machine, reset the root password to “x” and connects you directly to the console.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25e768b78de1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create ubuntu Image with virt-sysprep]]></title>
            <link>https://medium.com/@osama.ibrahim.89/how-to-create-ubuntu-image-with-virt-sysprep-98165b9b1c3c?source=rss-236e6d865cae------2</link>
            <guid isPermaLink="false">https://medium.com/p/98165b9b1c3c</guid>
            <category><![CDATA[kvm]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[libvirt]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[vm]]></category>
            <dc:creator><![CDATA[Osama Elswah]]></dc:creator>
            <pubDate>Thu, 02 Nov 2023 11:24:19 GMT</pubDate>
            <atom:updated>2023-11-02T11:24:19.522Z</atom:updated>
            <content:encoded><![CDATA[<p>I was trying to build an ubuntu 22.04 Image which I can use to build some ceph and openstack clusters</p><p>I ran into two problems<br>- SSH server was failing<br>- All the cloned VMs were getting the same IP. <br>- The .ssh folder was being delete from my user</p><p>For the second Problem I had to make sure that virt-sysprep delete the machine-id of the VM</p><pre>virt-sysprep .... --operations defaults,machine-id</pre><p>To keep my .ssh folder:</p><pre>virt-sysprer .... --oeprations defaults,machine-id,-ssh-userdir </pre><p>add a “-” before the ssh-userdir disables this operation for virt-sysprep</p><p>For the third problem I found out that ubuntu is not regenerating the host keys, for that you have to tell your image to reconfigure the openssh package, so I added this</p><pre>virt-sysprer .... --oeprations defaults,machine-id,-ssh-userdir virt-sysprer .... --oeprations defaults,machine-id,-ssh-userdir</pre><p>That solved my problems, and I was able to access my VM per SSH directly after cloning it.</p><p>The full command looks like this:</p><pre>sudo virt-sysprep -a /var/lib/libvirt/images/ubuntu22.04-clone.qcow2 --operations defaults,-ssh-userdir,machine-id --firstboot-command &#39;dpkg-reconfigure openssh-server&#39;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98165b9b1c3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to add a cdrom to a libvirt VM and boot from it]]></title>
            <link>https://medium.com/@osama.ibrahim.89/how-to-add-a-cdrom-to-a-libvirt-vm-and-boot-from-it-a0e46589e76f?source=rss-236e6d865cae------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0e46589e76f</guid>
            <category><![CDATA[libvirt]]></category>
            <category><![CDATA[qemu]]></category>
            <category><![CDATA[redhat-linux]]></category>
            <category><![CDATA[openstack]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Osama Elswah]]></dc:creator>
            <pubDate>Fri, 26 Nov 2021 08:01:21 GMT</pubDate>
            <atom:updated>2021-11-26T08:01:21.621Z</atom:updated>
            <content:encoded><![CDATA[<p>In this short article I will just document how to add a cdrom to a libvirt VM through editing the XML file</p><p>Edit the VM</p><pre>$ sudo virsh edit my-test-vm</pre><p>Add this code snippet</p><pre>&lt;disk type=’file’ device=’cdrom’&gt;<br>&lt;driver name=’qemu’ type=’raw&#39; cache=’none’/&gt;<br>&lt;source file=’/var/lib/libvirt/images/my-cdrom.iso’/&gt;<br>&lt;target dev=’sda’ bus=’sata’/&gt;<br>&lt;readonly/&gt;<br>&lt;address type=’drive’ controller=’0&#39; bus=’0&#39; target=’0&#39; unit=’0&#39;/&gt;<br>&lt;/disk&gt;</pre><p>You have to make sure that<br>1) the .iso file is owned by qemu:qemu<br>2) It has the permissions 0600</p><p>To be able to boot from the cdrom, you have to add this line in the &lt;os&gt; section</p><pre>&lt;boot dev=’cdrom’/&gt;</pre><p>Then shutdown the VM and restart it</p><pre>$ sudo virsh shutdown my-test-VM<br>$ sudo virsh start my-test-VM</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0e46589e76f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to synchronize-panes in tmux, and set a shortcut for it]]></title>
            <link>https://medium.com/@osama.ibrahim.89/how-to-synchronize-panes-in-tmux-and-set-a-shortcut-for-it-d52b677021e3?source=rss-236e6d865cae------2</link>
            <guid isPermaLink="false">https://medium.com/p/d52b677021e3</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[tmux]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Osama Elswah]]></dc:creator>
            <pubDate>Tue, 09 Nov 2021 16:39:19 GMT</pubDate>
            <atom:updated>2021-11-09T16:39:19.684Z</atom:updated>
            <content:encoded><![CDATA[<p>Synchronize-panes is a very useful feature in tmux. I use it occasionally at my customers’ environments.</p><p>To set it on in a session you can use</p><pre>ctrl+b : setw synchronize-panes on</pre><p>To shut it off you can use</p><pre>ctrl+b : setw synchronize-panes off</pre><p>Or you can just toggle it using</p><pre>ctrl+b : setw synchronize-panes</pre><p>To set a shortcut during the session you can</p><pre>ctrl+b : bind e setw synchronize-panes </pre><p>Then you can toggle it on or off using</p><pre>ctrl+b e</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d52b677021e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to roll out a single node Ceph-Cluster]]></title>
            <link>https://medium.com/@osama.ibrahim.89/how-to-roll-out-a-single-node-ceph-cluster-86807f8736b1?source=rss-236e6d865cae------2</link>
            <guid isPermaLink="false">https://medium.com/p/86807f8736b1</guid>
            <category><![CDATA[centos]]></category>
            <category><![CDATA[red-hat-training]]></category>
            <category><![CDATA[ceph]]></category>
            <dc:creator><![CDATA[Osama Elswah]]></dc:creator>
            <pubDate>Thu, 20 Aug 2020 21:56:29 GMT</pubDate>
            <atom:updated>2020-08-24T07:47:45.334Z</atom:updated>
            <content:encoded><![CDATA[<p>I noticed that the internet is lacking an explanation on how to roll out a single node Ceph cluster using ceph-ansible. Therefore I decided to write this small article.</p><p>A single node Ceph cluster is useful if you want to test a feature or just learn how Ceph works. <strong>Don’t use it in production</strong>.</p><p>I assume the reader has the minimum knowledge of Ceph and doesn’t require explaining what are OSDs, Mons or Mgrs. However if something feels odd, please visit <a href="https://docs.ceph.com/docs/master/">https://docs.ceph.com/docs/master/</a></p><p>In this article we will install a single node containerized Ceph (version 15.2.4, latest version as of the time of this writing) on a CentOS 8.2 VM.</p><p>The VM has:</p><ul><li>8 GBs memory</li><li>50-GB hard disk for the OS</li><li>3*20GB hard disks for Ceph</li></ul><p>First we will start by downloading the Centos iso file; you will find it here <a href="https://www.centos.org/download/">https://www.centos.org/download/</a>.</p><p>Create the VM the way you want, I chose to create as a Libvirt VM, just make sure you can add more disks so that we can install Ceph.</p><p>To be able to run ceph-ansible we will need to create a user with passwordless sudo rights. <br>If you don’t know how to create one, here is the procedure:</p><pre>$ sudo adduser ansible # create the user<br>$ echo &quot;ansible ALL=(ALL)      NOPASSWD: ALL&quot; | sudo tee /etc/sudoers.d/ansible</pre><p>After creating the user we can download ceph-ansible, we will clone it from github.com, and we will use the branch stable-5.0 as our target is to install Ceph 15.2.4<br>To know which branch should be used to install the different Ceph versions visit the following website: <a href="https://docs.ceph.com/ceph-ansible/master/">https://docs.ceph.com/ceph-ansible/master/</a></p><pre>$ git clone https://github.com/ceph/ceph-ansible.git<br>$ cd ceph-ansible<br>$ git checkout stable-5.0</pre><p>Now it is time to configure the variable files to be able to run the playbooks<br>The first file we are going to create is the all.yml<br>This file contains the cluster configuration</p><pre>$ vi /home/ansible/ceph-ansible/group_vars/all.yml</pre><pre>---<br>dummy:<br>fetch_directory: fetch/<br>ceph_conf_local: true<br>centos_package_dependencies:<br>  - epel-release<br>  - &quot;{{ &#39;python3-libselinux&#39; if ansible_distribution_major_version | int &gt;= 8 else &#39;libselinux-python&#39; }}&quot;<br>ntp_service_enabled: true<br>ceph_directories_mode: &quot;0755&quot;<br>ceph_origin: repository<br>ceph_repository: community<br>ceph_mirror: <a href="http://download.ceph.com/">http://download.ceph.com</a><br>ceph_stable_key: <a href="https://download.ceph.com/keys/release.asc">https://download.ceph.com/keys/release.asc</a><br>ceph_stable_release: octopus<br>ceph_stable_repo: &quot;{{ ceph_mirror }}/debian-{{ ceph_stable_release }}&quot;<br>ceph_conf_key_directory: /etc/ceph<br>ceph_uid: 167<br>ceph_keyring_permissions: &#39;0600&#39;<br>cephx: true<br>rbd_cache: &quot;true&quot;<br>monitor_interface: enp1s0<br>public_network: 192.168.122.0/24<br>osd_objectstore: bluestore<br>ceph_conf_overrides:<br>  global:<br>    osd_pool_default_size: 1<br>    mon_warn_on_pool_no_redundancy: false<br>containerized_deployment: true<br>container_binary: podman<br>dashboard_protocol: http<br>dashboard_port: 8443<br>dashboard_admin_user: admin<br>dashboard_admin_password: p@ssw0rd<br>grafana_admin_user: admin<br>grafana_admin_password: admin</pre><p>Please note that the two parameters <em>osd_pool_default_size</em> and <em>mon_warn_on_pool_no_redundancy </em>where to set to 1 and false respectively as we have one node cluster, and ceph won’t be able to replicate the data across hosts.</p><p>Next file we define will be the osds.yml, which tells ceph-ansible how to create the OSDs, as we are trying to create a simple cluster we will stick with a simple configuration.</p><pre>$ vi /home/ansible/ceph-ansible/group_vars/osds.yml<br>osd_auto_discovery: true</pre><p>That tells ceph-ansible to auto discover the disks and supply the disks to ceph-volume, and let ceph-volume decide the best configuration. <br>To learn how that happens, you can learn more here: <a href="https://docs.ceph.com/docs/master/ceph-volume/lvm/batch/">https://docs.ceph.com/docs/master/ceph-volume/lvm/batch/</a></p><p>We need to define the inventory file, so that ansible knows where to install the Ceph containers. We will define the <em>ansible_connection</em> to local, as we are installing Ceph on the same host as ansible.</p><pre>$ vi /home/ansible/ceph-ansible/hosts<br>[mons]<br>ceph ansible_connection=local</pre><pre>[mgrs]<br>ceph ansible_connection=local</pre><pre>[osds]<br>ceph ansible_connection=local</pre><pre>[grafana-server]<br>ceph ansible_connection=local</pre><p>As a final step we will create the playbook that should be run. ceph-ansile already provides samples for the playbooks such as <em>site-container.yml.sample</em></p><pre>$ cp site-container.yml.sample site-container.yml</pre><p>Now we are at a stage where we can run the playbook.</p><pre>$ ansible-playbook -i hosts site-container.yml</pre><p>When the playbook finishes, Ceph should be installed on the local host. <br>To check the running containers:</p><pre>$ sudo podman ps -a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1J0ZrbJ_6bs9ItFLQBf5vQ.png" /></figure><p>To check the cluster’s health:</p><pre>$ sudo podman exec 5bee387939bc ceph -s</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*V4D7qqHK4A9ivizkDBGwXw.png" /></figure><p>We now have a running Ceph cluster, happy testing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86807f8736b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>