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.
  • Issues with PCIE Passthrough

    20
    0 Votes
    20 Posts
    3k Views
    J
    @ImThatFluffy said in Issues with PCIE Passthrough: @john-c Yea im not sure, it was either an issue with the way I had Debian setup or compatibility things booted up Ubuntu 22.04LTS with the HWE kernel and it worked perfectly. Well if you are using Ubuntu Linux 22.04.1 LTS or one of the later point releases then it would be using a Linux Kernel version 6.1 or later, when its a HWE kernel. So any bugs from earlier versions of the kernel would have been fixed, also the Intel ARC graphics hardware would have been released during one of the point releases. On the Debian Linux front a distribution version earlier than version 12.0 would have been unlikely to have complete properly functioning support, due to that release being the first one with the Linux kernel version of 6.1 or later.
  • Imbedded Docker

    docker container xcp-ng
    12
    0 Votes
    12 Posts
    6k Views
    S
    @DustinB said in Imbedded Docker: Has anyone else done this, and can provide benefits or faults in doing so, besides the obvious that this isn't officially supported? I am actually going through the process of trying this right now, and am having significant difficulties with the xscontainer-prepare-vm piece - it doesn't work. So far, I have built a Docker VM, made sure all prerequisites are in there, and then run this script. It does insert an ssh-rsa key into my user's authorized_keys file, but the public key it inserts doesn't actually work. The host is not able to ssh into the VM due to the certificate not matching and requires a password, which does not work because it can't pass the VM check. Has anyone else seen this behaviour before?
  • Issues with Windows 11 VM

    5
    0 Votes
    5 Posts
    2k Views
    planedropP
    I've got passthrough to work a number of times without issue, the only thing I had to make sure of was that all devices related to the GPU were passed through completely. Are you following the docs step by step? I have a Ubuntu VM running with a 2060 passed through right now, works flawlessly and even survived a power loss on the host.
  • How do I/should I disable the local webserver

    Solved
    11
    0 Votes
    11 Posts
    1k Views
    J
    @olivierlambert Thank you. We'll be looking into it when we upgrade the hardware.
  • Inquiry Regarding XCP-NG Web UI Access Issue

    6
    1
    0 Votes
    6 Posts
    3k Views
    planedropP
    @ajpri1998 I agree in regards to XOA getting damaged somehow, so that makes sense. I think my question here to OP was more about why they're concerned with it if they already have XOA. Normally if something happens to XOA though you'd SSH into the XCP-ng host and figure it out from there (which also means XO Lite could be enabled). Not criticizing at all, just was curious about the use case here in specific since it's being evaluated for enterprise use.
  • windows 11 Support

    11
    0 Votes
    11 Posts
    10k Views
    Z
    Could someone who tried Win11 with the latest XCP-ng beta confirm if hibernation works?
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Run a script inside guest OS from host

    22
    0 Votes
    22 Posts
    6k Views
    V
    Get Wendell to talk more about xcp-ng
  • Update strategy for a consistent XCP-ng pool

    8
    0 Votes
    8 Posts
    927 Views
    olivierlambertO
    Thanks, and also thank you for your feedback, it's important to understand the pain points to improve our product Keep us posted!
  • XCP : Server Failed

    7
    1
    0 Votes
    7 Posts
    703 Views
    olivierlambertO
    As a general rule, you MUST keep all your hosts up to date. If you update normally, you will be on a 8.2.1
  • VM Graceful shutdown using apc network shutdown

    6
    0 Votes
    6 Posts
    1k Views
    S
    @olivierlambert Ihave been tryign to get graceful power off to work with my nas whcih is Truenas by the way but i havent gotten it to work yet oddly i cant seem to get them talking yet
  • 0 Votes
    10 Posts
    895 Views
    D
    @Danp said in Patching and trying to Pool Hosts after they've been in production: Warm migration should work in this case because the VM is halted then restarted as part of the process. See here for more details. Sweet, I'll setup something small on the old host for testing and use the Warm Migration process.
  • Can not recover /dev/xvda2

    4
    1
    0 Votes
    4 Posts
    753 Views
    olivierlambertO
    There's no issue to restore everything from scratch, as long as your backup repo (BR/remote) is available. For example, fresh XCP-ng install, deploy XO, connect to the BR and it will find all your previous backups. Then restore, that's it!
  • Largest Stack?

    10
    0 Votes
    10 Posts
    1k Views
    D
    Now we have 76 VMs running on a 3 host pool. Each server has 320 GB of RAM. Our scenario doesn't need big CPU resources so everything works fine.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • 0 Votes
    11 Posts
    1k Views
    RAG67958472R
    anyone has any other ideas ?? I seem to be lost at what to do.
  • VM Templates does choosing correct one matter?

    4
    0 Votes
    4 Posts
    868 Views
    planedropP
    @wilsonqanda Yes, BIOS as well, assuming I am remembering right haha. If you just pick whatever is closest and go with it I doubt you'll run into issues, if you do just make a post here and I'm sure someone will be willing to help out or work on a new template or something.
  • 1 Votes
    6 Posts
    930 Views
    A
    @wilsonqanda Downgrading the EKD2 package fix it for now, as posted: yum downgrade edk2-20180522git4b8552d-1.5.1.xcpng8.3
  • Add kernel boot params for dom0

    4
    0 Votes
    4 Posts
    2k Views
    stormiS
    The grub setup is rather simple and not very flexible. There's just one file to modify, as you found out (/etc/grub.cfg in BIOS mode, /etc/grub-efi.cfg in EFI mode, both being symbolic links to the actual file location). You can add an entry to it, but there's a small chance this doesn't play well with scripts from either XenServer or ourselves which may want to update the file and get confused. It's usually better to just modify the existing entries, ideally using /opt/xensource/libexec/xen-cmdline, so that the file structure remains unchanged.
  • Menu Migrate to server missing

    Moved
    4
    0 Votes
    4 Posts
    380 Views
    olivierlambertO
    Ah that makes sense then