XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. samuelolavo
    S
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 9
    • Groups 0

    samuelolavo

    @samuelolavo

    0
    Reputation
    1
    Profile views
    9
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    samuelolavo Unfollow Follow

    Latest posts made by samuelolavo

    • RE: Clarification on Creating ResourceSet via xo-cli

      @julien-f

      Hello,

      When I try to create a:

      resourceSet.create name=test-resource subjects=["d301d9ea-9e22-4480-bf40-111111111111"]' objects='["8fb06362-d8fe-598b-f819-11111111111111"]' shareByDefault=1
      

      I always get this error:

      ✖ invalid parameters
        property @./subjects: must be array
        property @./objects: must be array
      

      Also, I don't know how to specify the resource limits.

      If you can help me, I would greatly appreciate it!

      Thank you very much!

      posted in REST API
      S
      samuelolavo
    • Clarification on Creating ResourceSet via xo-cli

      Hi,

      I am trying to create a resource set using the xo-cli command with the following syntax:

      xo-cli resourceSet.create name='test' subjects='["123"]' objects='["123", "456"]' limits='{"ram":"16","disk":"200","cpu":"8"}' tags='["3321"]' networks='["321"]' shareByDefault=true
      

      Could you please confirm if this is the correct way to create a resource set in Xen Orchestra, or if any adjustments are required to ensure successful execution?

      Thank you for your assistance!

      posted in REST API
      S
      samuelolavo
    • RE: xo-cli user.create issues

      @julien-f Good afternoon, I am using Node 21, and I believe the PHP configuration is correct.

      However, is it possible to create users via REST API? And also self-service?

      posted in REST API
      S
      samuelolavo
    • RE: xo-cli user.create issues

      @olivierlambert I have already verified, and I can execute the script directly in the shell without any issues. Is it possible to create a user via the REST API? I couldn't find any documentation on this topic.

      posted in REST API
      S
      samuelolavo
    • xo-cli user.create issues

      Good afternoon, I am using the Laravel framework, but I am having a lot of difficulties creating a user via shell_exec.

      $xoCommand = [
                     'xo-cli',
                     'user.create',
                     "email=$username",
                     "password=$randomPassword",
                     "permission=none"
                 ];
                 $this->info("Executing command: " . implode(' ', $xoCommand));
      
                 $process = new Process($xoCommand);
                 $process->run();
      

      When I execute the command, it constantly returns this error in the logs:

      [2024-10-28 13:44:35] local.INFO: Output from user:create command: Executing command: xo-cli user.create email=usertest password=1234 permission=none
      Error creating user in XO: internal/process/esm_loader.js:74
          internalBinding('errors').triggerUncaughtException(
                                    ^
      
      Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'fs' imported from /usr/local/lib/node_modules/xo-cli/index.mjs
          at packageResolve (internal/modules/esm/resolve.js:664:9)
          at moduleResolve (internal/modules/esm/resolve.js:705:18)
          at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:798:11)
          at Loader.resolve (internal/modules/esm/loader.js:100:40)
          at Loader.getModuleJob (internal/modules/esm/loader.js:246:28)
          at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:47:40)
          at link (internal/modules/esm/module_job.js:46:36) {
        code: 'ERR_MODULE_NOT_FOUND'
      }
      

      Can you please help me?

      I can execute other types of commands without any problem, such as:

      $output = shell_exec('xo-cli list-objects type=VM'); for example.
      
      posted in REST API
      S
      samuelolavo
    • RE: Inquiry about Obtaining VM Disk Space Usage via XO API or XO-CLI

      @olivierlambert
      Hi,

      At my workplace, we usually create virtual machines (VMs) for each user. However, some of these VMs are no longer in use. The goal is to understand how much storage space these inactive VMs are occupying.

      We have 3 SR block based per iSCSI

      posted in REST API
      S
      samuelolavo
    • Inquiry about Obtaining VM Disk Space Usage via XO API or XO-CLI

      Hello,

      I'm currently using Xen Orchestra (XO) to manage my virtual machines (VMs), and I need to retrieve the amount of disk space each VM is occupying on the underlying storage. Could you please guide me on how to achieve this using either the XO API or XO-CLI?

      Specifically, I would like to know:

      How can I programmatically retrieve the disk space usage for each VM via the XO API?
      Alternatively, how can I use XO-CLI to gather information about the disk space utilization of each VM?
      Any assistance or examples demonstrating the API endpoints or CLI commands to accomplish this task would be greatly appreciated.

      Thank you for your support.
      Samuel Olavo

      posted in REST API
      S
      samuelolavo
    • Accessing Resource Set and ACLs Information via API

      Hello everyone,

      I am currently working on integrating Xen Orchestra with our internal systems and I need to access specific information through the REST API. I have been able to retrieve various data points, but I am struggling to find details about the following:

      Resource Sets
      ACLs (Access Control Lists)
      Could anyone please guide me on whether it is possible to obtain information about Resource Sets and ACLs through the Xen Orchestra API? If so, what are the specific endpoints or methods to use for these resources?

      Thank you in advance for your help!

      Best regards,
      Samuel Olavo

      posted in REST API
      S
      samuelolavo