Incus copy has the following usage description:
pargo@bastion:~$ incus copy
Description:
Copy instances within or in between servers
Transfer modes (--mode):
- pull: Target server pulls the data from the source server (source must listen on network)
- push: Source server pushes the data to the target server (target must listen on network)
- relay: The CLI connects to both source and server and proxies the data (both source and target must listen on network)
The pull transfer mode is the default as it is compatible with all server versions.
Usage:
incus copy [<remote>:]<source>[/<snapshot>] [[<remote>:]<destination>] [flags]
Aliases:
copy, cp
Flags:
--allow-inconsistent Ignore copy errors for volatile files
-c, --config Config key/value to apply to the new instance
-d, --device New key/value to apply to a specific device
-e, --ephemeral Ephemeral instance
--instance-only Copy the instance without its snapshots
--mode Transfer mode. One of pull, push or relay (default "pull")
--no-profiles Create the instance with no profiles applied
-p, --profile Profile to apply to the new instance
--refresh Perform an incremental copy
--stateless Copy a stateful instance stateless
-s, --storage Storage pool name
--target Cluster member name
--target-project Copy to a project different from the source
Global Flags:
--debug Show all debug messages
--force-local Force using the local unix socket
-h, --help Print help
--project Override the source project
-q, --quiet Don't show progress information
--sub-commands Use with help or --help to view sub-commands
-v, --verbose Show all information messages
--version Print version number
According to the usage description, incus copy <source> --target-project <target project>
should work but I get the following.
pargo@bastion:~$ incus list
+-------------------+---------+--------------------+------+-----------+-----------+------------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | LOCATION |
+-------------------+---------+--------------------+------+-----------+-----------+------------+
| pedrojorge-PAPCMC | STOPPED | | | CONTAINER | 0 | dedicado01 |
+-------------------+---------+--------------------+------+-----------+-----------+------------+
| robertty-exp | RUNNING | 10.11.21.70 (eth0) | | CONTAINER | 0 | dedicado02 |
+-------------------+---------+--------------------+------+-----------+-----------+------------+
| robertty-exp2 | RUNNING | 10.11.21.71 (eth0) | | CONTAINER | 0 | dedicado03 |
+-------------------+---------+--------------------+------+-----------+-----------+------------+
pargo@bastion:~$ incus project list
+--------------------+--------+----------+-----------------+-----------------+----------+---------------+-----------------------+---------+
| NAME | IMAGES | PROFILES | STORAGE VOLUMES | STORAGE BUCKETS | NETWORKS | NETWORK ZONES | DESCRIPTION | USED BY |
+--------------------+--------+----------+-----------------+-----------------+----------+---------------+-----------------------+---------+
| compartilhado | YES | YES | YES | YES | NO | NO | | 2 |
+--------------------+--------+----------+-----------------+-----------------+----------+---------------+-----------------------+---------+
| dedicado (current) | YES | YES | YES | YES | NO | NO | | 4 |
+--------------------+--------+----------+-----------------+-----------------+----------+---------------+-----------------------+---------+
| default | YES | YES | YES | YES | YES | YES | Default Incus project | 8 |
+--------------------+--------+----------+-----------------+-----------------+----------+---------------+-----------------------+---------+
| sandbox | YES | YES | YES | YES | NO | NO | | 5 |
+--------------------+--------+----------+-----------------+-----------------+----------+---------------+-----------------------+---------+
| services | YES | YES | YES | YES | NO | NO | | 7 |
+--------------------+--------+----------+-----------------+-----------------+----------+---------------+-----------------------+---------+
pargo@bastion:~$ incus copy pedrojorge-PAPCMC --target-project compartilhado
Error: You must specify a destination instance name
That’s slighly odd since I thought the brackets meant the destination instance name was optional.
With a destination instance name I get the following.
pargo@bastion:~$ incus copy pedrojorge-PAPCMC pedrojorge-PAPCMC2 --target-project compartilhado
Error: Failed to get address of instance's member: Instance not found
I can´t get the copy command to do what it was supposed to do.
Some information on what I’m running. It’s a cluster and I’ll post the information about both projects.
pargo@bastion:~$ incus cluster list
+-----------------+--------------------------+------------------+--------------+----------------+-------------+--------+-------------------+
| NAME | URL | ROLES | ARCHITECTURE | FAILURE DOMAIN | DESCRIPTION | STATE | MESSAGE |
+-----------------+--------------------------+------------------+--------------+----------------+-------------+--------+-------------------+
| compartilhado01 | https://10.11.16.11:8443 | database | x86_64 | default | | ONLINE | Fully operational |
+-----------------+--------------------------+------------------+--------------+----------------+-------------+--------+-------------------+
| compartilhado02 | https://10.11.16.12:8443 | database-standby | x86_64 | default | | ONLINE | Fully operational |
+-----------------+--------------------------+------------------+--------------+----------------+-------------+--------+-------------------+
| compartilhado03 | https://10.11.16.13:8443 | database | x86_64 | default | | ONLINE | Fully operational |
+-----------------+--------------------------+------------------+--------------+----------------+-------------+--------+-------------------+
| compartilhado04 | https://10.11.16.14:8443 | database-leader | x86_64 | default | | ONLINE | Fully operational |
| | | database | | | | | |
+-----------------+--------------------------+------------------+--------------+----------------+-------------+--------+-------------------+
| dedicado01 | https://10.11.16.31:8443 | | x86_64 | default | | ONLINE | Fully operational |
+-----------------+--------------------------+------------------+--------------+----------------+-------------+--------+-------------------+
| dedicado02 | https://10.11.16.32:8443 | database-standby | x86_64 | default | | ONLINE | Fully operational |
+-----------------+--------------------------+------------------+--------------+----------------+-------------+--------+-------------------+
| dedicado03 | https://10.11.16.33:8443 | | x86_64 | default | | ONLINE | Fully operational |
+-----------------+--------------------------+------------------+--------------+----------------+-------------+--------+-------------------+
pargo@bastion:~$ incus cluster group show compartilhado
description: ""
members:
- compartilhado01
- compartilhado02
- compartilhado03
- compartilhado04
name: compartilhado
pargo@bastion:~$ incus cluster group show dedicado
description: ""
members:
- dedicado01
- dedicado02
- dedicado03
name: dedicado
pargo@bastion:~$ incus project show compartilhado
config:
features.images: "true"
features.profiles: "true"
features.storage.buckets: "true"
features.storage.volumes: "true"
limits.instances: "4"
restricted: "true"
restricted.backups: allow
restricted.cluster.groups: compartilhado
restricted.cluster.target: allow
restricted.containers.nesting: allow
restricted.devices.nic: allow
restricted.snapshots: allow
description: ""
name: compartilhado
used_by:
- /1.0/profiles/default?project=compartilhado
- /1.0/images/77f67d56a4ba8e351e1b0d22034b65700a5e02ea28d0ae7f04d268c7a6a2bd2a?project=compartilhado
pargo@bastion:~$ incus project show dedicado
config:
features.images: "true"
features.profiles: "true"
features.storage.buckets: "true"
features.storage.volumes: "true"
limits.instances: "3"
restricted: "true"
restricted.backups: allow
restricted.cluster.groups: dedicado
restricted.cluster.target: allow
restricted.containers.nesting: allow
restricted.devices.nic: allow
restricted.snapshots: allow
description: ""
name: dedicado
used_by:
- /1.0/instances/pedrojorge-PAPCMC?project=dedicado
- /1.0/instances/robertty-exp?project=dedicado
- /1.0/instances/robertty-exp2?project=dedicado
- /1.0/profiles/default?project=dedicado
What am I doing wrong?