Skip to content

Copystack Commands

Egle Sigler edited this page Oct 13, 2017 · 2 revisions

Available Copystack commands are as shown bellow. Note that commands are for most cases sequential and must be executed in the order listed.

If you are going to replicate one OpenStack environment to the next, start with actions at the top. Do not skip steps.

For some cases, you can skip some of the steps. Commands can be re-run, but that also means that duplicate assets will be created on the "to" environment. Copystack does not destroy anything.

Some commands need to be run as OpenStack admins. Others, as appropriate users. Note: copystack is meant for older OpenStack versions, and as such, you may need to re-run some commands as different users to get a full copy of your "from" environment.

Some steps take a very long time. Let each step finish before starting the next.

python copystack.py -h
Usage: copystack.py [options]

Options:
  -h, --help            show this help message and exit
  -t, --tenants         Run this command as Admin. Print to and from tenants.
                        Tenant names must match before running the rest of
                        copystack
  -x, --createtenants   Run this command as Admin. Create tenants
                        from->to. Tenant names must match before running the
                        rest of copystack
  -u, --users           Run this command as Admin. Create users from->to.
                        Users created without passwords
  -q, --quota           Run this command as Admin. Print differences in
                        individual quotas for each tenant
  -f, --flavors         Run this command as Admin. Copy flavors from -> to
  -c, --copynets        Run this command as Admin. Copy networks and subnets
                        from->to
  -w, --routers         Run this command as Admin. Copy routers from->to
  -W, --addmissinginterfaces
                        Run this command as Admin. Add missing interfaces
                        between routers and networks and additional ports. It
                        will skip duplicates, but will print an exception that
                        it did so. If ports createdin error, delete them from
                        OpenStack command line with "neutron port-delete"
                        command.
  -s, --copysec         Copy security groups from -> to
  -p, --publickeys      Copy public keys from -> to
  -d, --download        Download all non-migration images to a specified path,
                        for example, ./downloads/.for each UUID provided in a
                        file, for example, ./id_file. First argument directory
                        path, second path to a file.  Images with names that
                        start with "migration_vm_image_" or
                        "migration_volume_image_" will not be moved. All
                        others will be.
  -l, --upload          Recreate all non-migration images in a new
                        environment. Provide a path, for example, ./downloads/
                        where images from "-d" where stored. Will not check
                        for duplicate image names, since duplicate names are
                        allowed. Images with names that start with
                        "migration_vm_image_" or "migration_volume_image_"
                        will not be moved. All others will be.
  -r, --report          Print Summary of Things
  -m, --shutdown        Shutdown VMs for each UUID provided in a file, for
                        example, ./id_file
  -i, --createimages    Create images from VMs for each UUID provided in a
                        file, for example, ./id_file. Volumes attached to VMs
                        will also be their images created.
  -o, --downloadbyvmid  First argument directory path, second path to a file.
                        Download all images by VM UUID to a specified path,
                        for example, ./downloads/ for each UUID provided in a
                        file, for example, ./id_file. Volumes associated with
                        the VMs will also be downloaded.
  -k, --uploadbyvmid    First argument directory path, second path to a file.
                        Upload all images by VM UUID from a specified path,
                        for example, ./downloads/ for each UUID provided in a
                        file, for example, ./id_file. Volumes associated with
                        the VMs will also be uploaded.
  -g, --migratevms      Create migrated VMs each UUID provided in a file, for
                        example, ./id_file.
  -G, --securitygroups  Attach security groups to migrated VMs for each UUID
                        provided in the original migration file, for example,
                        ./id_file.
  -z, --createvmvolumes
                        Create and attach volumes for VMs that were migrated
                        from each UUID provided in a file, for example,
                        ./id_file.
  -v, --singlevolumeimagecreate
                        Create images of unattached volumes for each UUID
                        provided in the ./id_volume_file
  -V, --singlevolumeimagedownload
                        Download images of unattached volumes as specified in
                        volume ID fileto a specified path, for example,
                        ./downloads/ ./id_volume_file
  -y, --singlevolumeimageupload
                        Upload images of unattached volumes from a specified
                        path as specified in volume ID file, for example,
                        ./downloads/ ./id_volume_file
  -Y, --singlevolumecreate
                        Create un-attached volumes from images as specified in
                        volume ID file, for example, ./id_volume_file
Clone this wiki locally