XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    • Profile
    • Following 0
    • Followers 4
    • Topics 0
    • Posts 105
    • Groups 4
    fohdeeshaF Offline
    1. Home
    2. fohdeesha

    fohdeesha

    @fohdeesha

    Vates 🪐 Pro Support Team
    182
    Reputation
    1.9k
    Profile views
    105
    Posts
    4
    Followers
    0
    Following
    Joined
    Last Online
    Location Indianapolis

    fohdeesha Unfollow Follow
    Pro Support Team Vates 🪐 XCP-ng Team Admin
    • RE: Any updated tutorial on how to create new cloud images?

      @encryptblockr The issue is the cloud-init project is so disorganized and is constantly introducing more and more OS-dependent workarounds, bugs, and oddities that any documentation will become useless in a few months. I maintain our XOA Hub cloud-init builds, and I have to personally rewrite my own documentation every single time we push out a new image because cloud-init has broken something new, changed or removed config options without documenting it, or the underlying OS has changed how it deals with networking files etc and cloud-init has not been updated to deal with that. For example: I don't think the below will work any longer networking wise with netplan based distros, like newer ubuntus.

      For debian/ubuntu, this is my rough process currently, but it's not worth putting in an official blog or document guide because it will be rendered useless and just cause people frustration the next release cloud-init puts out, the next debian or ubuntu version change, etc. You'll note none of this is related to XCP-ng at all (except for xen tools obviously), so the below is documentation cloud-init should really be publishing themselves - I have a feeling they also know it would quickly be rendered useless as well so they don't bother. Anyway:

      #create a new debian or ubuntu VM in XCP-ng with a ~10gb disk. During the install ISO process, you'll have to choose manual partitioning, and either remove the swap partition completely from the partition layout, or move it to the beginning of the disk. If you choose auto partitioning, it will put a swap partition after the data partition, so the data partition won't be able to be expanded on your template. Once it's installed and running, install xcp-ng guest utilities. To get the latest version, use our guest-utilities ISO. Once all that xen-specific stuff is done, you can start the cloud-init setup: Start with installing cloud-init in the first place:

      apt-get install -y cloud-init cloud-utils cloud-initramfs-growroot
      

      Set the root and default user to random passwords, then disable password logins (this is done on our templates so only pubkey based logins are accepted, skip this optionally):

      echo 'root:dfgdfgdfg' | chpasswd
      echo 'ubuntu:dfgdfg' | chpasswd
      passwd -l root
      passwd -l ubuntu
      nano /etc/ssh/sshd_config #set permitrootlogin to "no"
      

      Clean networking stuff that the VM picked up via dhcp from your current network, they will be re-populated with current info whenever the template is deployed:

      nano /etc/resolv.conf #remove all
      nano /etc/hosts # remove everything but localhost
      

      Now the important part, set the main cloud init config. Edit /etc/cloud/cloud.cfg - What exactly you need to edit here is impossible to document, as the default values in this file change across every OS, and are changed across every cloud-init version, with no documentation indicating they have done so. The actual behavior of a given option has also been changed out of nowhere. So I'll try to summarize. You want to remove any datasource_list or datasource blocks, and replace them with these values:

      datasource_list: [ NoCloud, ConfigDrive ]
      datasource:
          ConfigDrive:
              dsmode: local
          NoCloud:
              fs_label: cidata
      

      You'll need to find and change (or add) these vars as well so networking is properly handled:

      manage_resolv_conf: true
      manage_etc_hosts: true
      preserve_hostname: false
      

      Also find the default_user block, and change it to whatever username you set up during the install ISO (the user aside from root). On our templates we name this user after the OS, so the non-root user on the ubuntu template is "ubuntu", so that part of the cloud-init config looks like this:

         default_user:
           name: ubuntu
      

      If your file doesn't have the following somewhere in it, add it (I've had to add it on some builds, on other builds it was magically there already):

      users:
         - default
      disable_root: true
      

      On some older cloud-init versions, I had to manually re-order the module init staging order, because cloud-init could not be bothered to get this right themselves. I think (???) this has been resolved in later builds, but again it changes constantly so there's no way to know. Basically, ensure these three modules are under the first "cloud_init_modules" that run during the init stage, not under the later config or final stage:

       - set_hostname
       - update_hostname
       - update_etc_hosts
      

      Save the config file, and hopefully you're done with that. I can't outline just how unreliable documenting this file is - the defaults, the behavior of certain options, or even the presence of certain options changes entirely across OS's and cloud-init versions, so I can't just keep a "master copy" of the config file and expect it to work. You have to examine the default file you get line by line and work towards the values above until the template works properly. When it stops working properly 3 months later, browse the cloud-init mailing lists and github issues to figure out which option's behavior they changed without any warning, and repeat.

      Now remove all the random config files that cloud-init occasionally decides to install that will override your own config and render it useless. This list of files changes whenever cloud-init builds feel like it, so just look in the parent directory to see what's there on your specific cloud-init version:

      rm -rf /etc/cloud/cloud.cfg.d/99-installer.cfg /etc/cloud/cloud.cfg.d/90_dpkg.cfg /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg
      

      Remove any stuff the VM picked up that you don't want in all your templates. This also cleans any cloud-init runs that might have occurred if you rebooted the VM, so the template you end up with will be "fresh". We also remove the command history for the root user and default user

      rm -rf /etc/ssh/ssh_host_*
      cloud-init clean --logs
      su - ubuntu
      cat /dev/null > ~/.bash_history && history -c && exit
      cat /dev/null > ~/.bash_history && history -c && exit
      

      Now you can shut the VM down and convert it into a template. Whenever deploying, it will already have xen guest tools, and a disk that will automatically be expanded to whatever you set the disk size to when deploying

      NOTE: If you plan on using the "network config" cloud-init box during VM creation in XOA, note that whatever you put in that box is ADDED to the VM's default network config. It does not REPLACE it. That means when you follow the directions above, almost all OS's will have a default config of DHCP on eth0 in /etc/network/interfaces - so if you fill out the cloud-init network box during VM creation to set a static IP, the VM will still read the DHCP config, get a DHCP address, then read the cloud-init created network config files under /etc/network/interfaces.d/* and add that static IP as well. If you want to configure VMs with only static IPs you configure during VM deployment with cloud-init for example, you would have to remove the dhcp config stuff out of /etc/network/interfaces on your template VM when creating it

      posted in Xen Orchestra
      fohdeeshaF
      fohdeesha
    • RE: XO debian 10 cloud ready VM template (cloud-init)

      @mietek I can assure you there's no malicious intent to mislead you, why we would do that to our users is beyond me. Olivier is simply one of the most busy people I've worked with, and he still takes the time to come here and answer free users when he can. He might not have the time to scour the internet and github for the relevant patches and news for niche threads like this. We were not made aware of the cloud-init fix until just a few days ago when a patch was submitted. Cloud-init has been notoriously hard to support and document because the upstream project is constantly doing things like this, and as you noticed it can affect how it works on one OS version versus another very differently. If it were up to me we would drop built-in support for it because of this mess (and a lot of large projects have dropped it entirely and moved to Ignition, like CoreOS) but a lot of users still find it very useful so we continue to support it as best we can, baring with the mess going on upstream.

      I'm not sure if you're aware, but Olivier is the founder and CEO of Vates, who is behind both XCP-ng and XOA. I welcome you to go to the ESXI forum and try and get the CEO of VMware to personally answer your questions, as a free user to top it off.

      posted in Xen Orchestra
      fohdeeshaF
      fohdeesha
    • RE: Assign second ipadres to network card

      @rtjdamen Copying my reply to your official support ticket (any reason for duplicating support tickets on the forum as well?):

      given XOA is built on standard debian, you can assign multiple IPs to the same interface quite easily by just duplicating another "iface eth1 inet static" line. Also keep in mind XOA does not add extra interfaces under the main /etc/network/interfaces file, but in files under the /etc/network/interfaces.d/ directory. So in your case given it was eth1 you wanted a second IP on, you can add your required second IP in this file like so:

      [09:43 12] xoa:~$ cat /etc/network/interfaces.d/eth1
      allow-hotplug eth1
      iface eth1 inet static
       address 192.168.1.80
       netmask 255.255.255.0
      
      #second IP
      iface eth1 inet static
       address 172.16.100.5
       netmask 255.255.255.0
      
      posted in Management
      fohdeeshaF
      fohdeesha
    • RE: XCP-ng 8.3 updates announcements and testing

      @gb.123 those scsi messages can be expected and ignored when a USB enclosure is connected, some USB enclosures do not emulate SCSI Enclosure Services (SES) very well, so the kernel complains when it queries them and gets nonsense back. USB passthrough devices are still visible and enumerated by dom0's kernel. If you remove the drive the messages will go away, but they can be safely ignored.

      posted in News
      fohdeeshaF
      fohdeesha
    • RE: French government initiative to support

      Why is it these people can never spell?

      posted in News
      fohdeeshaF
      fohdeesha
    • RE: Realtek 8187 (RTL8187) driver

      @jivanpal I think trying to get OpenVswitch (our underlying network layer) managing and using a wifi dongle for core hypervisor networking would be a nightmare, and you'd probably need to install some extra packages to handle the authentication / WPA management etc - then of course there's zero guarantee OVS wouldn't overwrite or revert any of this custom stuff for said interface (OVS was not designed to work with wifi)

      Not to mention you'd have to have a relatively hackable AP, one that will allow the dongle to source a lot of different MAC addresses, which is pretty rare. From OVS's own docu:

      e55b26f6-b82c-4461-a0a3-e725d3dea4f0-image.png

      posted in Development
      fohdeeshaF
      fohdeesha
    • RE: XCP-NG vm's extremly slow

      @Andi79 https://www.youtube.com/watch?v=tDacjrSCeq4

      posted in Compute
      fohdeeshaF
      fohdeesha
    • RE: XCP-NG Slow VM vs Bare Metal

      @zxcp Something is very broken - with customers and most users we typically see around ~90% of bare metal perfs (in things like passmark and real use). This is with modern virtualization using PVHVM - which is what most of the templates should default to if your hardware supports it. What hardware is this exactly? is it running the latest bios/firmware and you've ensured it has VT-D / IOMMU / etc enabled? In simple cases of poor virtualization overhead we may expect to see something like ~30% worse performance compared to bare metal, so maybe an 8 minute ubuntu install instead of 5. Three hours means something is very broken somewhere - could be storage related as well as installs are usually very write heavy. If you attach a dmesg from XCP-ng it should make it clear what your hardware supports virt wise

      posted in Compute
      fohdeeshaF
      fohdeesha
    • RE: Weird issue with PCIe passthrough and XCP-NG/Xenserver

      @alexanderk Heh yes, and a few other Brocade/Quanta/Dell guides

      posted in Compute
      fohdeeshaF
      fohdeesha
    • RE: XO from sources

      +1 for avoiding 3rd party install scripts, the official install doc is like, 10 commands? I think it takes maybe 10 minutes or less the last time I did it on a fresh debian system, and you know it's always the correct instructions (which is NOT the case with 3rd party scripts, as you'll see in this forum when even the slightest architectural change is made to the XO sources). You also get to learn at least a little bit about the architecture of what you're installing and running instead of pressing go on a script you grabbed from some guy's github and hoping the XO web interface appears. I thought the whole point of "homelab" (for which sources are intended and primarily used) was learning and developing skills in the first place?

      No disrespect intended to the people that create and maintain said scripts, it just seems to me like it bypasses the point of sources a little bit 🙂

      posted in Xen Orchestra
      fohdeeshaF
      fohdeesha
    • RE: Tag-Based Automation Plugin: Tag-Based VM Performance & Permission Management via assigned tag(s)

      @johnnezero if you copy/paste all those findings to a claude fable/opus or openAI Astra model, it's scarily good at fixing everything, just tell it to test test test 🙂

      posted in Management
      fohdeeshaF
      fohdeesha
    • RE: Tag-Based Automation Plugin: Tag-Based VM Performance & Permission Management via assigned tag(s)

      @johnnezero Hi! Thank you for your contribution to the vates / XCP ecosystem! It's certainly appreciated. However there seems to be a few "vibe-code-isms" in the plugin source that has caused us some support tickets on Vates side - the main issue is that you're doing two synchronous NFS operations (fs.existsSync & fs.appendFileSync) for every single log entry with no buffering or batching. Being synchronous, the entire node event loop locks up dead until the NFS call completes. So your plugin writing ~500 log lines whenever it runs at the top of the hour (or whenever else) is doing 2000+ NFS sync calls, locking up the node event loop for nearly 60 full seconds - meaning XOA loses the ability to contact hosts, perform operations, etc. This is made exponentially worse by the logger writing to XOA backup mounts, as when an XOA backup is running, the NFS share is typically quite loaded with backup traffic, making the logging sync operations take many times longer.

      We've seen a couple customers whose backups started failing due to this which was interesting to track down - it appears as just the XOA appliance losing network connectivity to the pool, when in fact it's because xo-server is completely locked up waiting on logging activity from this plugin while the backup run is trying to call XAPI on the customer pool.

      there's some other stuff like the enforcePerformance performing four writes over xapi on every single VM unconditionally every single call, instead of checking if the value is already set correctly and doesn't need a write. Stuff like vm.VCPUs_params and vm.other_config which XOA already intelligently maintains a cache of, so 99% of these routine calls should theoretically require zero xapi writes, or even reads. Here's a full analysis from Claude (I am not a dev, and our current XO devs are swamped so I didn't want to bother them with this 😛 )

      The hourly enforcement cycle blocks the Node.js event loop for tens of seconds.
      xo-server runs every pool connection in that same single threaded process, so
      the block starves xen-api's event watcher. Its event.from long poll has a
      60.1 second client side deadline, the timer cannot fire on time, and when it
      does xen-api treats the connection as dead and reconnects. Reconnecting
      flushes the XO object cache. Backup jobs starting in that window fail with
      no such object <pool-uuid>.

      The block is synchronous NFS I/O, one call per log line, inside loops over
      hundreds of rows.

      Evidence

      Four _watchEvents TimeoutError events fired within the same second, one second
      after the cycle's preload phase ended:

      call deadline actual
      1 60.1 s 99.4 s
      2 60.1 s 67.1 s
      3 60.1 s 66.4 s
      4 60.1 s 66.2 s

      Timers with deadlines spread across 33 seconds do not batch like that unless the
      loop was starved and then released. The pool master logged no XAPI errors during
      the window, and its session.login_with_password from the XOA address matches
      the reconnect exactly.

      Over a longer window, 18 timeout events since 1 August, 9 of them within 90
      seconds of the top of an hour.

      Findings

      1. Synchronous NFS I/O in the logging path (critical)

      writeLog (line 279) makes two blocking filesystem calls per log line, both
      against the NFS mount:

      if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });  // stat RPC
      fs.appendFileSync(logPath, message + "\n", "utf8");               // open+write+close
      

      logInfo (290) and logWarn (298) both call it, twice when summary is set.
      About 270 log lines per cycle at roughly four round trips each is about 1100
      blocking calls. Measured block was 39 seconds, implying about 35 ms per call,
      consistent with the share being under backup write load at the time.

      Other synchronous calls on the same mount: rotateLogs (231, 234, 244, 245,
      258, 261), readLogTail (310, 311) which reads up to 10 MB, CSV reads (587,
      619, 662, 750), and full CSV writes (645, 849).

      console.log is not a contributor. Node writes to a pipe asynchronously.

      2. Unconditional XAPI writes on every VM, every hour

      enforcePerformance, lines 450 to 453:

      await xapi.call("VM.remove_from_VCPUs_params", vm._xapiRef, "weight");
      await xapi.call("VM.add_to_VCPUs_params",      vm._xapiRef, "weight", String(matched.weight));
      await xapi.call("VM.remove_from_other_config", vm._xapiRef, "sched-pri");
      await xapi.call("VM.add_to_other_config",      vm._xapiRef, "sched-pri", String(matched.ioPri));
      

      No check for whether the value is already correct, though the cache already
      holds vm.VCPUs_params and vm.other_config. Four writes per tagged VM per
      hour, each journaled by XAPI and broadcast through event.from to every client,
      including the process that is currently frozen. The plugin generates the event
      storm it then cannot drain.

      The remove-then-add pair is also non-atomic. Between the calls the VM has
      neither weight nor sched-pri.

      Same pattern for tags at 688 and 794, where VM.add_tags is called blind and a
      duplicate key error is caught afterwards. The cached vm.tags already answers
      that.

      3. xo.getAllGroups() inside per-VM and per-tag loops

      Line 501 in enforcePermissions, line 552 in applyPermissionTag. The latter is
      called inline from runCsvSync (696) and processPreloadVms (831), multiplying
      the cost.

      4. xo.getXapi(vm) unguarded

      Lines 681 and 786. It throws no connection found for object <uuid> when the
      pool is disconnected, which is the state the plugin creates for itself. Neither
      is wrapped, so one disconnected pool aborts the whole cycle through
      runEnforcementCycle (891, which rethrows). enforcePerformance handles this
      correctly at 446; the other two do not.

      5. The preload queue never drains

      processPreloadVms (742) removes a row only on a successful match (839). A row
      naming a VM that does not exist, was decommissioned, lives on an unconnected
      pool, or was mistyped is retried forever. The observed instance held 216 such
      rows, producing 216 synchronous NFS writes per hour to report that nothing
      happened. That is roughly 80 percent of the plugin's blocking I/O.

      The message "not found or filtered" also conflates a missing VM with one
      rejected by isRealVm, and the lookup at 774 searches across every connected
      pool, taking whichever the index returns first on a name collision.

      6. Repeated full object scans and quadratic lookups

      Object.values(xo.getObjects({ type: "VM" })) is rebuilt at 430, 487, 583, 653,
      749, 860, 996, and 1018, several in the same cycle. VM resolution is a linear
      Array.find at 601, 678, and 774. The CSV is regenerated from the VM list, so
      row count tracks VM count and runCsvSync is quadratic in pool size.

      7. No guard against concurrent cycles

      runEnforcementCycle is reachable from the cron job (905, 941), the test
      action (1000), and xo-server-tag-automation.runSync (1005). None check whether
      a cycle is running. A manual "Run Now" during the hourly tick doubles everything.

      8. Scheduling

      getCron (182) maps hourly to 0 * * * *, and createSchedule (905, 914,
      941, 950) is called with no timezone, so it fires on the hour in appliance local
      time. That collides with every other scheduled job, including backups.

      9. Dead code in isRealVm

      Lines 346 to 349. All three exact matches contain the substring tested on 346,
      so the last three branches are unreachable.

      10. Unverified object model

      location code issue
      337, 338 vm.$type and vm.type both tested only one exists
      404 to 413 four property fallback chain for notes only one is the real field
      601, 678 (v.uuid \|\| v.id) both exist, with defined meanings

      vm._xapiRef (450 to 453, 688, 720, 794, 813) is an internal field that can go
      stale after a reconnect, and nothing revalidates it.

      11. Minor

      • rotateLogs (229) rotates only FILE_LOG; summary and daily logs grow without
        bound.
      • writeRefreshedCsv (640) never quotes fields while parseCsvLine (194)
        handles quotes, so a value containing a double quote round trips incorrectly.
      • The CSV is read twice per cycle (619, 662), three times with autopilot enabled
        (587).
      • configure() (925) reassigns _config, but a cycle already in flight holds
        the old reference.
      posted in Management
      fohdeeshaF
      fohdeesha
    • RE: XCP-ng 8.3 updates announcements and testing

      @gb.123 those scsi messages can be expected and ignored when a USB enclosure is connected, some USB enclosures do not emulate SCSI Enclosure Services (SES) very well, so the kernel complains when it queries them and gets nonsense back. USB passthrough devices are still visible and enumerated by dom0's kernel. If you remove the drive the messages will go away, but they can be safely ignored.

      posted in News
      fohdeeshaF
      fohdeesha
    • RE: XCP-ng 8.3 betas and RCs feedback 🚀

      @r0ssar00 hi, that issue would arise if you ran this script with python3, but it's interpreter is set as /usr/bin/python - How did you call this script, did you manually call it with python3? It should be ran by just running the command on the CLI eg interface-rename

      posted in News
      fohdeeshaF
      fohdeesha
    • RE: Ubuntu 22.04 Cloud-init disk size issue

      @jubin3 As this is totally unrelated to XOA and XCP-ng, you'll (hopefully) get a better response in the cloud-init community, as it's their project which has (once again) been broken by an OS update. I gave up chasing them some time ago, especially with brand new OS releases.

      posted in Advanced features
      fohdeeshaF
      fohdeesha
    • RE: Assign second ipadres to network card

      @rtjdamen Copying my reply to your official support ticket (any reason for duplicating support tickets on the forum as well?):

      given XOA is built on standard debian, you can assign multiple IPs to the same interface quite easily by just duplicating another "iface eth1 inet static" line. Also keep in mind XOA does not add extra interfaces under the main /etc/network/interfaces file, but in files under the /etc/network/interfaces.d/ directory. So in your case given it was eth1 you wanted a second IP on, you can add your required second IP in this file like so:

      [09:43 12] xoa:~$ cat /etc/network/interfaces.d/eth1
      allow-hotplug eth1
      iface eth1 inet static
       address 192.168.1.80
       netmask 255.255.255.0
      
      #second IP
      iface eth1 inet static
       address 172.16.100.5
       netmask 255.255.255.0
      
      posted in Management
      fohdeeshaF
      fohdeesha
    • RE: 10 gig secondary network

      @abelaguilar indeed you do not have to fill out the dns and gateway fields - in fact as you surmised you shouldn't. Where you getting an error or something when leaving them blank? The only mandatory fields are IP and netmask.

      posted in Xen Orchestra
      fohdeeshaF
      fohdeesha
    • RE: Second ip for hosts interface

      @SNSNSN Indeed, these would typically at least be isolated via vlans at least (one vlan for iscsi traffic, one for iscsi). There's no point in having them in two different subnets if they're in the same network and vlan, the traffic isn't isolated at all. You might as well have them in the same subnet if you're doing that, in which case you only need 1 IP on the XCP-ng management NIC.

      posted in Xen Orchestra
      fohdeeshaF
      fohdeesha
    • RE: Second ip for hosts interface

      @SNSNSN Hi, this isn't possible, at least not without a lot of manual workarounds. It's not recommended anyhow, why do you need to assign another subnet to an adapter already in a different subnet? These should typically be isolated either physically via different connections, or via VLANs.

      posted in Xen Orchestra
      fohdeeshaF
      fohdeesha
    • RE: Windows Server 2022 Essentials

      @olivierlambert never done it myself, but this is indeed exactly what the feature "Copy host BIOS strings to VM" was intended for as @Andrew mentioned. Hopefully the BIOS strings this feature copies are enough for the ROK installer to recognize the "authorized" dell hardware

      posted in Development
      fohdeeshaF
      fohdeesha