maas deletes products/images locally that do not exist remotely

Bug #1508975 reported by Scott Moser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Wishlist
Blake Rouse

Bug Description

Maas imports images to deploy and use for boot resources from streams. It imports a number of products from each stream, such as:
  com.ubuntu.maas.daily:v2:boot:14.04:amd64:hwe-t
  com.ubuntu.maas.daily:v2:boot:14.04:amd64:hwe-u
  com.ubuntu.maas.daily:v2:boot:14.04:amd64:hwe-v
  com.ubuntu.maas.daily:v2:boot:15.04:amd64:hwe-v

If the product is removed from the remote stream, and maas does 'boot resources import', it will be *deleted* locally. This is a bug for a few reasons:
 * accidental deletion of products on the server side will break customers.
 * Canonical cannot remove products *ever* from the server side
   if these products (such as 14.10) go unsupported, we'd like to no
   longer make them available or at very least move them to 'old-releases' like
   location. However, if we do that, then we'd be breaking existing
   users as they'd have workflow that worked before and not after.

I found this with the following.
Installed maas from maas-maintainers/stable.

$ dpkg-query --show maas
maas 1.8.2+bzr4041-0ubuntu1~trusty1

created a local mirror of stream data like:
$ sstream-mirror --max=1 --progress http://maas.ubuntu.com/images/ephemeral-v2/daily/streams/v1/index.json out.d os=ubuntu release=trusty arch=amd64

I then pointed maas at that mirror rather than the daily mirror.
I did the import, and dump-image-status (https://gist.github.com/smoser/2cec72d243404a72fdb5) which simply shows which products maas has available to deploy/use.

$ ./dump-image-status admin
ubuntu/trusty amd64/hwe-t 20151020 daily True
ubuntu/trusty amd64/hwe-u 20151020 daily True
ubuntu/trusty amd64/hwe-v 20151020 daily True

Then, I manually edited the stream data as seen: http://paste.ubuntu.com/12894365/
to remove the 'com.ubuntu.maas.daily:v2:boot:14.04:amd64:hwe-t' product.

And I re-imported:

$ maas admin boot-resources import

waited a bit, and saw:
$ ./dump-image-status admin
ubuntu/trusty amd64/hwe-u 20151020 daily True
ubuntu/trusty amd64/hwe-v 20151020 daily True

Related branches

Scott Moser (smoser)
summary: - maas deletes products locally that do not exist remotely
+ maas deletes products/images locally that do not exist remotely
Changed in maas:
milestone: none → 1.9.0
importance: Undecided → High
Changed in maas:
importance: High → Wishlist
Gavin Panella (allenap)
Changed in maas:
status: New → Triaged
Changed in maas:
milestone: 1.9.0 → next
Changed in maas:
milestone: next → 2.1.0
Changed in maas:
status: Triaged → In Progress
assignee: nobody → Blake Rouse (blake-rouse)
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.