XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. jcharles
    3. Posts
    J
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 8
    • Groups 0

    Posts

    Recent Best Controversial
    • xo-cli vm.importFromEsxi give error: JsonRpcError: can't get runtime of object devtest1 (Type: VirtualMachine)

      Hi, I am tying to migrate a test vm from ESXi 7 to xcp-ng but I get an error. I have tried moving the esxi VM to a different host and renaming the vm, Also tried reinstalling xo-cli.

      npm uninstall -g xo-cli
      npm install -g xo-cli

      But no luck.

      Here is my command:

      xo-cli vm.importFromEsxi host=x.x.x.x network=e5befe87-ed23-fcc2-1f1a-3883a1123dcb password=XXXXX sr=2e9ff937-6c4c-86c5-81d2-18331c69bbe5 sslVerify=false stopSource=true user=root template=39f341be-b9aa-c7fd-33a9-355312c2246a vm=devtest1
      āœ– JsonRpcError: can't get runtime of object devtest1 (Type: VirtualMachine)
          at Peer._callee$ (C:\Users\jcharles\AppData\Roaming\npm\node_modules\xo-cli\node_modules\json-rpc-peer\dist\index.js:139:44)
          at tryCatch (C:\Users\jcharles\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\regeneratorRuntime.js:45:16)
          at Generator.<anonymous> (C:\Users\jcharles\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\regeneratorRuntime.js:133:17)
          at Generator.next (C:\Users\jcharles\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\regeneratorRuntime.js:74:21)
          at asyncGeneratorStep (C:\Users\jcharles\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\asyncToGenerator.js:3:17)
          at _next (C:\Users\jcharles\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\asyncToGenerator.js:17:9)
          at C:\Users\jcharles\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\asyncToGenerator.js:22:7
          at new Promise (<anonymous>)
          at Peer.<anonymous> (C:\Users\jcharles\AppData\Roaming\npm\node_modules\xo-cli\node_modules\@babel\runtime\helpers\asyncToGenerator.js:14:12)
          at Peer.exec (C:\Users\jcharles\AppData\Roaming\npm\node_modules\xo-cli\node_modules\json-rpc-peer\dist\index.js:182:20) {
        code: -32000,
        data: {
          message: "can't get runtime of object devtest1 (Type: VirtualMachine)",
          name: 'Error',
          stack: "Error: can't get runtime of object devtest1 (Type: VirtualMachine)\n" +
            '    at Esxi.fetchProperty (file:///usr/local/lib/node_modules/xo-server/node_modules/@xen-orchestra/vmware-explorer/esxi.mjs:451:13)\n' +
            '    at processTicksAndRejections (node:internal/process/task_queues:95:5)',
          succeeded: {}
        }
      }
      
      posted in Migrate to XCP-ng
      J
      jcharles
    • RE: How to Use xo-cli to Get network=<XCP_Network_UUID> and sr=<XCP_SR_UUID> for vm.importFromEsxi Command?

      Thanks that worked. I give that a go thanks

      posted in REST API
      J
      jcharles
    • RE: How to Use xo-cli to Get network=<XCP_Network_UUID> and sr=<XCP_SR_UUID> for vm.importFromEsxi Command?

      yes we have vmware vcenter but V2V does not interface with that.

      thanks

      posted in REST API
      J
      jcharles
    • RE: How to Use xo-cli to Get network=<XCP_Network_UUID> and sr=<XCP_SR_UUID> for vm.importFromEsxi Command?

      The vm guests are located on hundreds of different esxi hosts in a large number of different data centres. At the moment the V2V only allows a single esxi host login at a time which limits the number of vm guests I can setup and process.

      I get the feeling the xo-cli will not supply the information I need for my script. Do you have a powershell module for xcp-ng like VMware powercli which gives you the ability to write very complex scripts.

      Thanks

      posted in REST API
      J
      jcharles
    • RE: How to Use xo-cli to Get network=<XCP_Network_UUID> and sr=<XCP_SR_UUID> for vm.importFromEsxi Command?

      Hi,
      Importing from hundreds of vmware hosts each using different passwords would be a nightmare to setup in the V2V GUI, unless you access the vmware vcenter to copy the vmdk files from vmware.
      So for my original question is there a way I can write a script using xo-cli to get the network=<XCP_Network_UUID> and sr=<XCP_SR_UUID> information. With this and ability to monitor migration tasks using xo-cli (that will be another forum post) I will be able to script the migration.
      Thanks

      posted in REST API
      J
      jcharles
    • RE: How to Use xo-cli to Get network=<XCP_Network_UUID> and sr=<XCP_SR_UUID> for vm.importFromEsxi Command?

      Hi,
      Yes I have used that but it is a GUI and I have thousands of VM guests to migrate from Vmware to xcp-ng. So I would like to write a script to migrate the using the xo-cli vm.importFromEsxi. I am new to xcp-ng as getting this type of information is very easy in vmware with it powershell powercli. I have tied the following code but it gets multiple UUID's.

      Define variables for pool name and VLAN

      $poolName = "Dev-Pool" # Replace with your pool name
      $vlan = 8 # Replace with your VLAN ID

      Load the JSON data

      $jsonData = xo-cli list-objects | ConvertFrom-Json -AsHashTable

      Find the pool UUID based on the pool name

      $poolUUID = ($jsonData | Where-Object { $.type -eq "pool" -and $.name_label -eq $poolName }).uuid

      Find the SR UUID associated with the pool

      $srUUID = ($jsonData | Where-Object { $.type -eq "VDI" -and $.'$pool' -eq $poolUUID }).'$SR'

      Find the Network UUID associated with the VLAN and pool

      $networkUUID = ($jsonData | Where-Object { $.type -eq "PIF" -and $.vlan -eq $vlan -and $_.'$pool' -eq $poolUUID }).'$network'

      Output the results

      Write-Output "SR UUID: $srUUID"
      Write-Output "Network UUID: $networkUUID"

      posted in REST API
      J
      jcharles
    • RE: How to Use xo-cli to Get network=<XCP_Network_UUID> and sr=<XCP_SR_UUID> for vm.importFromEsxi Command?

      Hi, I want to script the migration of vmware to xcp-ng. As the estate of xcp-ng grows it will make looking up the information more and more complicated,

      Thanks

      posted in REST API
      J
      jcharles
    • How to Use xo-cli to Get network=<XCP_Network_UUID> and sr=<XCP_SR_UUID> for vm.importFromEsxi Command?

      I am trying to use the xo-cli command vm.importFromEsxi to import a VM. I have the pool name (e.g., Dev-Pool) and VLAN number. How can I use xo-cli to retrieve the required network=<XCP_Network_UUID> and sr=<XCP_SR_UUID> values for this command?
      Any guidance or examples would be greatly appreciated!

      posted in REST API
      J
      jcharles