Page MenuHomePhabricator

Make same glance images available to multiple regions
Closed, ResolvedPublic

Description

In order to migrate instances and also to spin up new instances we need to be able to access the image repository.

Strategy here falls into two broad camps:

  • Have each glance offer identical images through syncing (probably manually this is very static)
  • Use the same glance backend or even just API service itself for both regions

Shared:

labtest and labtestn
main and ?

Event Timeline

chasemp triaged this task as Medium priority.Apr 9 2018, 1:06 PM
chasemp created this task.

I just changed the glance endpoints on labtestn so that they're the same as for labtest:

# openstack endpoint list | grep glance
| 600fcde1d37d4399b4c43a93cf4df32c | codfw1dev-r | glance       | image        | True    | admin     | http://labtestcontrol2001.wikimedia.org:9292                 |
| 65f03ed128194078847101acbeaf0462 | codfw1dev-r | glance       | image        | True    | internal  | http://labtestcontrol2001.wikimedia.org:9292                 |
| 673526070ce0449fb5b68fe1db746bdd | codfw       | glance       | image        | True    | internal  | http://labtestcontrol2001.wikimedia.org:9292                 |
| 6e8dc055d72d475f9a6adeb6f62495d9 | codfw       | glance       | image        | True    | public    | http://labtestcontrol2001.wikimedia.org:9292                 |
| 9642be0471e24313aafc6e2dfd9e0323 | codfw       | glance       | image        | True    | admin     | http://labtestcontrol2001.wikimedia.org:9292                 |
| bd969e5f2ef1423691ff693eec791f54 | codfw1dev-r | glance       | image        | True    | public    | http://labtestcontrol2001.wikimedia.org:9292                 |

I also modified nova.conf on labtestcontrol2003 and labtestvirt2003 so that the 'glance' urls point to labtestcontrol2001.

Which those changes, I seem able to launch VMs in labtestn with images from labtest:

root@labtestcontrol2003:~# OS_REGION_NAME=codfw openstack image list
+--------------------------------------+---------------------------------+--------+
| ID                                   | Name                            | Status |
+--------------------------------------+---------------------------------+--------+
| 5051534c-6b47-47fc-a269-eefdd0b4422c | debian-jessie                   | active |
| 4c5a4ebf-c6c2-45f9-bc91-87dbd2d8015d | debian jessie (aborrero test 6) | active |
| 60a53f48-2708-4427-964a-f78095cbf52d | debian jessie (aborrero test 5) | active |
| 4a51eed3-caa0-4f63-9fb9-342ac206e2e5 | debian jessie (aborrero test 4) | active |
| b64c3d2a-06a3-4160-9012-afd1748cbd02 | debian jessie (aborrero test 3) | active |
+--------------------------------------+---------------------------------+--------+
root@labtestcontrol2003:~# openstack server show f81c08ae-a07d-4f9d-8d25-ee373877b5c8
+--------------------------------------+----------------------------------------------------------+
| Field                                | Value                                                    |
+--------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                                   |
| OS-EXT-AZ:availability_zone          | nova                                                     |
| OS-EXT-SRV-ATTR:host                 | labtestvirt2003                                          |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | labtestvirt2003.codfw.wmnet                              |
| OS-EXT-SRV-ATTR:instance_name        | i-0000003a                                               |
| OS-EXT-STS:power_state               | 1                                                        |
| OS-EXT-STS:task_state                | None                                                     |
| OS-EXT-STS:vm_state                  | active                                                   |
| OS-SRV-USG:launched_at               | 2018-06-13T14:10:30.000000                               |
| OS-SRV-USG:terminated_at             | None                                                     |
| accessIPv4                           |                                                          |
| accessIPv6                           |                                                          |
| addresses                            | flatcloudinstancesb=172.16.128.57, 172.16.128.58         |
| config_drive                         |                                                          |
| created                              | 2018-06-13T14:09:55Z                                     |
| flavor                               | m1.small (2)                                             |
| hostId                               | 9f22c3099c8d7359d332defb939c7b58d1e15444bfe6d46e7a9cee6e |
| id                                   | f81c08ae-a07d-4f9d-8d25-ee373877b5c8                     |
| image                                | debian-jessie (5051534c-6b47-47fc-a269-eefdd0b4422c)     |
| key_name                             | None                                                     |
| name                                 | labtestntest-3                                           |
| os-extended-volumes:volumes_attached | []                                                       |
| progress                             | 0                                                        |
| project_id                           | andrewtestproject                                        |
| properties                           |                                                          |
| security_groups                      | [{u'name': u'default'}, {u'name': u'default'}]           |
| status                               | ACTIVE                                                   |
| updated                              | 2018-06-13T14:10:30Z                                     |
| user_id                              | novaadmin                                                |
+--------------------------------------+----------------------------------------------------------+

So... I think that's that? We can just point both our regions to a single glance endpoint and have done. @chasemp are there additional complications you anticipate here?

Nope, it's entirely possible that multi-region glance is just that simple because glance isn't too picky. I think though that what you want is glance running on labtestcontrol2003 (debian) to use the databases from labtestcontrol2001's glance. small change here and if this works I imagine that's no big deal.

Change 440147 had a related patch set uploaded (by Andrew Bogott; owner: Andrew Bogott):
[operations/puppet@production] nova: move glance_host into hiera so it can be configured per-deploy

https://gerrit.wikimedia.org/r/440147

Change 440147 merged by Andrew Bogott:
[operations/puppet@production] nova: move glance_host into hiera so it can be configured per-deploy

https://gerrit.wikimedia.org/r/440147

Tests in labtest suggest that adding glance endpoints to multiple regions works just fine.

Re-opening because we need to actually merge the glance service in main and eqiad1.

Change 452595 had a related patch set uploaded (by Andrew Bogott; owner: Andrew Bogott):
[operations/puppet@production] openstack glance: move active service for eqiad1 and main to cloudcontrol1003

https://gerrit.wikimedia.org/r/452595

Change 452596 had a related patch set uploaded (by Andrew Bogott; owner: Andrew Bogott):
[operations/puppet@production] Openstack glance: remove glance service from labcontrol1001

https://gerrit.wikimedia.org/r/452596

Change 452595 merged by Andrew Bogott:
[operations/puppet@production] openstack glance: move active service for eqiad1 and main to cloudcontrol1003

https://gerrit.wikimedia.org/r/452595

Change 452596 merged by Andrew Bogott:
[operations/puppet@production] Openstack glance: remove glance service from labcontrol1001

https://gerrit.wikimedia.org/r/452596

Change 452949 had a related patch set uploaded (by Andrew Bogott; owner: Andrew Bogott):
[operations/puppet@production] Remove unused 'glance' profile for main deploy.

https://gerrit.wikimedia.org/r/452949

eqiad1 and eqiad glance are now merged, both using glance on cloudcontrol1003.

Change 452949 merged by Andrew Bogott:
[operations/puppet@production] Remove unused 'glance' profile for main deploy.

https://gerrit.wikimedia.org/r/452949