Subcategories

  • All Xen related stuff

    582 Topics
    6k Posts
    marcoiM
    is there anyway to block igpu from being used by xcp-ng during boot? I have it setup for pass through but it fails under the VM. I think it because xcp-ng still displaying the console screen and does not want to give it up.
  • The integrated web UI to manage XCP-ng

    23 Topics
    331 Posts
    P
    @coolsport00 Here is a hint in xo 5 when the newly created vm is running. [image: 1756487404025-c5c5e02c-937d-47ff-a257-b5aaddba23de-image.png]
  • Section dedicated to migrations from VMWare, HyperV, Proxmox etc. to XCP-ng

    102 Topics
    1k Posts
    sidS
    @cichy I know this isn't as easy as what you're asking for, but I wrote some terrible python code. It relies on health checks being defined as VM tags, or at least the management agent being detected. For example in my terraform code I have these tags on a test postgres instance and test nginx instances respectively: # postgres tags = [ "bootOrder/agent-detect-timeout=45", "bootOrder/ip=${jsonencode("auto")}", "bootOrder/healtcheck/tcp=${jsonencode({ "port" : 5432, })}", ] # nginx tags = [ "bootOrder/agent-detect-timeout=45", "bootOrder/ip=${jsonencode("auto")}", "bootOrder/healtcheck/http=${jsonencode({ "port" : 80, "scheme" : "http", "path" : "/" })}", ] Then the actual python: #!/usr/bin/env python3 import urllib3 import json import os import sys import socket import time import logging logging.basicConfig(level=logging.INFO) BOOT_ORDER = [ # Postgres ["55e88cb4-0c50-8384-2149-cf73e40b8c8e"], # nginx ["ba620f01-69d1-ddd8-b1d4-c256abe07e05", "bbe333bd-380a-1f94-4052-881c763b6177"], ] DEFAULT_AGENT_DETECT_TIMEOUT_SECONDS = 60 class HealthCheck: def __init__(self, target: str, config: dict) -> None: self.type = "base" self.target = target self.config = config self.timeout = 3 self.retry_max_count = 5 self.retry_cur_count = 0 self.retry_sleep = 10 def _retry(self): if self.retry_cur_count == 0: logging.info("Starting %s healtcheck against %s", self.type, self.target) self.retry_cur_count += 1 return True if self.retry_cur_count == self.retry_max_count: logging.warning('Failed Healtcheck of type %s for %s', self.type, self.target) return False time.sleep(self.retry_sleep) self.retry_cur_count += 1 return True class TCPHealthCheck(HealthCheck): def __init__(self, **kwargs): super().__init__(**kwargs) self.type = "TCP" def run(self): port = self.config.get("port") while self._retry(): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: sock.settimeout(self.timeout) success = sock.connect_ex((self.target, port)) == 0 if success: return True return False class HttpHealthCheck(HealthCheck): def __init__(self, **kwargs): super().__init__(**kwargs) self.type = "HTTP" def run(self): while self._retry(): assert_hostname = self.config.get("tls_verification", True) http = urllib3.PoolManager( cert_reqs="CERT_REQUIRED" if assert_hostname else "CERT_NONE", ) scheme = self.config.get("scheme", "http") port = self.config.get("port", 80) path = self.config.get("path", "").lstrip("/") url = f"{scheme}://{self.target}:{port}/{path}" response = http.request('GET', url, timeout=self.timeout) if response.status >= 200 and response.status < 300: return True return False class XoaClient: def __init__(self, base_url: str, token: str) -> None: self.base_url = base_url.rstrip("/") self.tags_prefix = "bootOrder/" self.token = token self.http = urllib3.PoolManager() self.headers = { "Content-Type": "application/json", "Cookie": f"token={self.token}", } self._vm_cache = {} def vm_ip(self, uuid): vm_tags = self._extract_vm_tags(uuid) ip = vm_tags.get("ip", "auto") if ip != "auto": return ip return self._get_vm(uuid).get("mainIpAddress") def vm_healthcheck(self, uuid): vm_tags = self._extract_vm_tags(uuid) tcp = vm_tags.get("healtcheck/tcp") http = vm_tags.get("healtcheck/http") return tcp, http def _get_vm(self, uuid: str): url = f"{self.base_url}/rest/v0/vms/{uuid}" # if url in self._vm_cache: # return self._vm_cache[url] response = self.http.request("GET", url, headers=self.headers) result = self._handle_json_response(response) self._vm_cache[url] = result return result def _extract_vm_tags(self, uuid: str) -> dict: dict_tags = {} tags = self._get_vm(uuid).get("tags") for tag in tags: if tag.startswith(self.tags_prefix): k,v = tag.split("=", 1) k = k[len(self.tags_prefix):] dict_tags[k] = json.loads(v) return dict_tags def start_vm(self, uuid: str): if self._get_vm(uuid).get("power_state") == "Running": return url = f"{self.base_url}/rest/v0/vms/{uuid}/actions/start?sync=true" response = self.http.request("POST", url, headers=self.headers) if response.status != 204: raise Exception(f"HTTP {response.status}: {response.data.decode('utf-8')}") return def management_agent_detected(self, uuid: str) -> bool: return self._get_vm(uuid).get("managementAgentDetected") def vm_agent_detection_timeout(self, uuid: str, default_seconds: int = 60) -> bool: tags = self._extract_vm_tags(uuid) return tags.get("agent-detect-timeout", default_seconds) def _handle_json_response(self, response): if response.status >= 200 and response.status < 300: return json.loads(response.data.decode("utf-8")) else: raise Exception(f"HTTP {response.status}: {response.data.decode('utf-8')}") if __name__ == "__main__": xoa_url = os.getenv("XOA_URL") xoa_token = os.getenv("XOA_TOKEN") if not xoa_url: logging.fatal("Missing XOA_URL environment variable") sys.exit(1) if not xoa_token: logging.fatal("Missing XOA_TOKEN environment variable") sys.exit(1) client = XoaClient(xoa_url, xoa_token) group_number = 1 for boot_group in BOOT_ORDER: logging.info("Starting to boot group %s, length %s", group_number, len(boot_group)) # These should be booted in parallel, but aren't for uuid in boot_group: client.start_vm(uuid) timeout = client.vm_agent_detection_timeout( uuid=uuid, default_seconds=DEFAULT_AGENT_DETECT_TIMEOUT_SECONDS, ) mad = False for n in range(timeout): mad = client.management_agent_detected(uuid) if mad: break time.sleep(1) if not mad: raise Exception(f"No management agent detected in host {uuid}") target = client.vm_ip(uuid) tcp, http = client.vm_healthcheck(uuid) if tcp: hc = TCPHealthCheck(target=target, config=tcp) hc.run() if http: hc = HttpHealthCheck(target=target, config=http) hc.run() logging.info("All healthchecks passed for %s", target) group_number += 1 It'll boot each VM in order and wait for its agent to be detected, then wait for all its health checks to pass before moving on to the next VM. This is by no means production ready code, but it might be a decent solution. Finally a systemd timer would be set up on the XOA instance to auto-run this script on boot.
  • Hardware related section

    125 Topics
    1k Posts
    K
    @DustinB Hmm - just got done running mem86+ - 4 passes -- all 14 tests. No RAM errors. I wonder the what would cause this error? I'll probably just save config and reinstall. So strange.
  • The place to discuss new additions into XCP-ng

    241 Topics
    3k Posts
    yannY
    @olivierlambert updating the README will be quick enough... but if the sig is indeed mandatory we need to setup something for this first... and autosigning from a CI rather requires doing that on a trusted runner rather than on gitlab-provided ones, so that requires some provisioning and IT work first.
  • 8.3 USB Passthrough - Win Server 2019 BSOD

    19
    1
    0 Votes
    19 Posts
    1k Views
    M
    @andsmith windbg is also a regular win32 app and is included in any recent windows SDK. Here: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/ You just need windbg so deselect all the other crap.
  • VDI export of running VM

    7
    0 Votes
    7 Posts
    1k Views
    olivierlambertO
    Yes, you can use XO webhooks (IIRC) to trigger something before or after a backup and send the request to a custom agent you made inside the VM. But I'm not sure to get it, can you provide what do you want to achieve, not the technical solution (script VM backup is already a solution, not the problem you are trying to solve)
  • Is Cold Migration of VMs from XCP-ng 8.3 back to 8.2.1 Not Supported?

    6
    0 Votes
    6 Posts
    886 Views
    stormiS
    @andrewperry The release notes warn about PV guests.
  • 8.3 cannot contact other host using TLS

    1
    0 Votes
    1 Posts
    207 Views
    No one has replied
  • XO-lite issue - 8.3 / IPv6

    2
    1
    0 Votes
    2 Posts
    294 Views
    BenjiReisB
    @PimAarts hi! Thx for the report - I reproduced the issue and am investigating. Meanwhile clicking on Cancel will give you access to XOLite
  • Failed upgrade to 8.3 now stuck on grub

    7
    2
    0 Votes
    7 Posts
    579 Views
    olivierlambertO
    2 times the charm I have no idea why it failed initially, but at least you tested the magic rollback As you can see, it's really a GREAT feature
  • Host not running VMs after update

    16
    2
    0 Votes
    16 Posts
    1k Views
    T
    We are now live again with all the VMs - which is a relief. The above steps from @stormi were great, the one thing I notced was the /etc/stunnel/certs directory didn't exist. I created that manually and everything else seemed happy. I did have to mess about a bit with the fibre NICs, but I've repeated the previous renaming and that's now running fine. Thanks very much for all the help - I appreciate it.
  • 1 Votes
    58 Posts
    16k Views
    olivierlambertO
    There is some diff, but not that much between HyperV, ESXi and Xen. However, it's big enough to require a lot of effort to get nested working correctly, one small mistake and your VM is dead.
  • Change Default Grub Option In 8.3 To Serial Console

    2
    0 Votes
    2 Posts
    246 Views
    E
    @elvintmp75 I should have searched forum better lol. Because it’s UEFI the file is in a different location https://xcp-ng.org/forum/post/11939
  • Live Migrate fails with `Failed_to_suspend` error

    8
    1
    0 Votes
    8 Posts
    949 Views
    R
    @randyrue Confirmed that after cold booting a VM to a new host I can then migrate it live to another new host.
  • XCP-ng 8.2.1 Guest UEFI Secure Boot

    12
    0 Votes
    12 Posts
    1k Views
    MathieuRAM
    I see that the bug is actually already fixed on the latest version (5.98.1).
  • Guest running kernel 6.8 hangs after a while

    Solved
    17
    0 Votes
    17 Posts
    3k Views
    T
    I believe Proxmox Backup Server kernel Linux pbs 6.8.4-2-pve has also the same issue. updating to Linux pbs 6.8.12-1-pve solves.
  • Protectli now available preinstalled with XCP-NG

    6
    1
    1 Votes
    6 Posts
    575 Views
    olivierlambertO
    @darkbounce Short answer: it seems that Intel hybrid architecture is finding a way to make something that would result of Xen running the VM with the less "featured" CPU, meaning your VM will never use all P core instructions that aren't on E core, meaning... it will work without disabling one or another. Hard to tell how much is lost in terms of perfs vs the best Intel hybrid scheduler (which is on... Windows) but probably not that much on a machine with a reduced number of P cores like this one.
  • Mirror moved Permanently

    8
    0 Votes
    8 Posts
    1k Views
    olivierlambertO
    @yammy I hope you are not talking of installing Docker in the Dom0, because this is really a bad idea.
  • xo vm-export / vm-import issue with latest XCP-Ng 8.3

    10
    0 Votes
    10 Posts
    795 Views
    P
    @Pix [image: 1724423840376-capture-d-e-cran-2024-08-23-a-16.36.56.png] Looks like the different HW or Pool is an issue, i'll make more tests and report here if it's ok
  • Disable DHCP option 60 when PXE booting

    10
    0 Votes
    10 Posts
    723 Views
    P
    @PontusB i don't even know if disabling option 66 solves the issue but as soon as we add option 66 in our DHCP server it boots fine from XenServer (but without HA between the many PVS servers).
  • Issue after latest host update

    57
    0 Votes
    57 Posts
    15k Views
    M
    @stormi Thanks, looking forward.
  • Vates please work acquiring vmware in the future

    3
    0 Votes
    3 Posts
    351 Views
    T
    @olivierlambert There you go hehe
  • yum update, no more free space?

    8
    0 Votes
    8 Posts
    1k Views
    I
    @bloodyskullz If you still see the old ISO SR, the easiest way to migrate is simply by creating a new one and migrate the ISOs through XO to the new one. In regards to deletion of the old SR you need to check if it really is mapped to another drive or if the mapping was not working and it filled / if so, you might not be able to delete it
  • Guide to Replace Tianocore UEFI Logo

    1
    1
    1 Votes
    1 Posts
    759 Views
    No one has replied