Arbutus Migration Guide: Difference between revisions

No edit summary
Line 65: Line 65:
== Migrating volume-backed instances ==
== Migrating volume-backed instances ==


Volume-backed instances as their name implies have a persistent volume attached to them containing the operating system and any required data. General best practices would involve a smaller volume for the operating system and a larger volume for data sets.
Volume-backed instances, as their name implies, have a persistent volume attached to them containing the operating system and any required data. Best practice is to use separate volumes for the operating system and for data.


=== Migration using Glance images ===
=== Migration using Glance images ===
Line 71: Line 71:
This method is recommended for volumes less than 150GB in size. For volumes larger than that, creating new volumes in Arbutus Cloud and copying the required data across from West Cloud is preferred to creating Glance images and transferring the images between clouds.
This method is recommended for volumes less than 150GB in size. For volumes larger than that, creating new volumes in Arbutus Cloud and copying the required data across from West Cloud is preferred to creating Glance images and transferring the images between clouds.


# SSH to the migration host ''cloudmigration.computecanada.ca'' with your Compute Canada credentials.
# Open two SSH sessions to the migration host ''cloudmigration.computecanada.ca'' with your Compute Canada credentials.
# In one session, source the OpenStack RC file for West Cloud. In the other session, source the OpenStack RC file for Arbutus Cloud. As mentioned earlier, use of the screen command is recommended in case of SSH disconnections.
# In one session, source the OpenStack RC file for West Cloud. In the other session, source the OpenStack RC file for Arbutus Cloud. As mentioned earlier, use of the <code>screen</code> command is recommended in case of SSH disconnections.
# In the West Cloud web UI, create an image of the desired volume (Compute -> Volumes and Upload to Image from the drop down menu). It is recommended that the volume is not in use, but the force option can be used if it is. The command line can also be used to do this:
# In the West Cloud web UI, create an image of the desired volume (Compute -> Volumes and Upload to Image from the drop down menu). We recommend that the volume is not in use, but the ''force'' option can be used if it is. The command line can also be used to do this:
#:<code>cinder --os-volume-api-version 2 upload-to-image <volumename> <imagename> --force</code>
#:<code>cinder --os-volume-api-version 2 upload-to-image <volumename> <imagename> --force</code>
# Once the image is created, it will show up under Compute -> Images with the name specified in the previous step. You can obtain the id of the image by clicking on the name.
# Once the image is created, it will show up under Compute -> Images with the name you specified in the previous step. You can obtain the id of the image by clicking on the name.
# In the West Cloud session on the migration host, download the image (replace the <filename> and <imageid> with real values):
# In the West Cloud session on the migration host, download the image (replace the <filename> and <image-id> with real values):
#: <code>glance image-download --progress --file <filename> <imageid></code>
#: <code>glance image-download --progress --file <filename> <image-id></code>
# In the Arbutus Cloud session on the migration host, upload the image (replace the <filename> with the name from the previous step; the <imagename> can be anything)
# In the Arbutus Cloud session on the migration host, upload the image (replace <filename> with the name from the previous step; <image-name> can be anything)
#: <code>glance image-create --progress --visibility private --container-format bare --disk-format qcow2 --name <imagename> --file <filename></code>
#: <code>glance image-create --progress --visibility private --container-format bare --disk-format qcow2 --name <image-name> --file <filename></code>
# A volume can now be created from the uploaded image. In the Arbutus Cloud web UI, navigate to Compute -> Images. The uploaded image from the previous step should be there. In the drop down menu for the image, there is an option to Create Volume. Select this option and the volume will be created from the image. The created volume can then be attached to instances or used to boot a new instance.
# You can now create a volume from the uploaded image. In the Arbutus Cloud web UI, navigate to Compute -> Images. The uploaded image from the previous step should be there. In the drop down menu for the image, select the option ''Create Volume'' and the volume will be created from the image. The created volume can then be attached to instances or used to boot a new instance.
# Once your instances/volumes are migrated & validated and any associated DNS records updated, please delete your old instances/volumes on the legacy West Cloud.
# Once you have migrated and validated your instances and volumes, and once all associated DNS records updated, please delete your old instances and volumes on the legacy West Cloud.


=== Alternative method: Migrating a volume-backed instance using Linux 'dd' ===
=== Alternative method: Migrating a volume-backed instance using Linux 'dd' ===


# Launch a temporary instance on West Cloud with the smallest flavor possible “p1-1.5gb”. The instructions below assume CentOS 7, but any Linux distribution with Python and Pip available should work.
# Launch an instance on West Cloud with the smallest flavor possible “p1-1.5gb”. We will call this the "temporary migration host". The instructions below assume you choose CentOS 7 for this instance, but any Linux distribution with Python and Pip available should work.
# Login to the instance via SSH and install the OpenStack CLI in a root shell:
# Log in to the instance via SSH and install the OpenStack CLI in a root shell:
#: <code>yum install epel-release</code>
#: <code>yum install epel-release</code>
#: <code>yum install python-devel python-pip gcc</code>
#: <code>yum install python-devel python-pip gcc</code>
#: <code>pip install python-openstackclient</code>
#: <code>pip install python-openstackclient</code>
# The OpenStack CLI should now be installed. To verify, try executing <code>openstack</code> on the command line. For further instructions, including installing the OpenStack CLI on systems other than CentOS, see: [https://docs.openstack.org/newton/user-guide/common/cli-install-openstack-command-line-clients.html https://docs.openstack.org/newton/user-guide/common/cli-install-openstack-command-line-clients.html]
# The OpenStack CLI should now be installed. To verify, try executing <code>openstack</code> on the command line. For further instructions, including installing the OpenStack CLI on systems other than CentOS, see: [https://docs.openstack.org/newton/user-guide/common/cli-install-openstack-command-line-clients.html https://docs.openstack.org/newton/user-guide/common/cli-install-openstack-command-line-clients.html]
# Copy your OpenStack RC file from Arbutus to the instance and source it. Verify that you can connect to the OpenStack API on Arbutus by executing the following command:
# Copy your OpenStack RC file from Arbutus to the temporary migration host and source it. Verify that you can connect to the OpenStack API on Arbutus by executing the following command:
#: <code>openstack image list</code>
#: <code>openstack image list</code>
# Delete the instance to be moved; however do NOT delete the volume it is attached to.
# Delete the instance to be moved, but do NOT delete the volume it is attached to.
# The volume is now free to be attached to the temporary migration host we created. Attach the volume to the temporary migration host by going to Compute -> Volumes in the West Cloud web UI. Select “Manage Attachments” from the drop down menu and attach the volume to the temporary migration host.
# The volume is now free to be attached to the temporary migration host we created. Attach the volume to the temporary migration host by going to Compute -> Volumes in the West Cloud web UI. Select “Manage Attachments” from the drop down menu and attach the volume to the temporary migration host.
# Note the device that the volume is attached as (typically <code>/dev/vdb</code> or <code>/dev/vdc</code>).
# Note the device that the volume is attached as (typically <code>/dev/vdb</code> or <code>/dev/vdc</code>).
# Use the <code>dd</code> utility to create an image from the attached disk of the instance (You can call the image whatever you prefer other than the example “volumemigrate”. When the command completes, you will receive output showing the details of the image created):
# Use the <code>dd</code> utility to create an image from the attached disk of the instance. You can call the image whatever you prefer; in the following example we've used “volumemigrate”. When the command completes, you will receive output showing the details of the image create:
#: <code>dd if=/dev/vdb | openstack image create --private --container-format bare --disk-format raw "volumemigrate"</code>
#: <code>dd if=/dev/vdb | openstack image create --private --container-format bare --disk-format raw "volumemigrate"</code>
# You should now be able to see the image under Compute -> Images in the Arbutus Cloud web UI. This image can now be used to launch instance(s) on Arbutus. Make sure to create a new volume when launching the instance if you want the data to be persistent.
# You should now be able to see the image under Compute -> Images in the Arbutus Cloud web UI. This image can now be used to launch instances on Arbutus. Make sure to create a new volume when launching the instance if you want the data to be persistent.
# Once your instances/volumes are migrated & validated and any associated DNS records updated, please delete your old instances/volumes on the legacy West Cloud.
# Once you have migrated and validated your volumes and instances, and once any associated DNS records updated, please delete your old instances and volumes on the legacy West Cloud.


== Migrating ephemeral instances ==
== Migrating ephemeral instances ==
Bureaucrats, cc_docs_admin, cc_staff
2,879

edits