Migrating a deployed bundle to charmhub

Hi,

I’m questionning myself now that Charmhub replaced Charmstore, I have a bundle deployed with “cs:” prefixed charms in it. How can I update my bundle with non “cs:” prefixed charms and switch to the charmhub provided charms without having to redeploy ? Maybe this is not necessary but for example, here :

Model    Controller       Cloud/Region        Version  SLA          Timestamp
ost-vit  maas-controller  maas-cloud/default  2.9.22   unsupported  10:59:59+01:00

App              Version  Status  Scale  Charm            Store       Channel  Rev  OS      Message
rabbitmq-server  3.8.2    active      3  rabbitmq-server  charmstore  stable   118  ubuntu  Unit is ready and clustered

As you can see, the rabbitmq-server is coming from Charmstore and is not up to date (latest release on charmhub is 123). This charm was redeployed less than a week ago and I thought juju would have transitionned by itself to the new Charmhub.

Any clarification gladly appreciated

Hi Walid

Are you the author of the charm deployed with cs: ? if so , you need to republish with the latest charmcraft tool…

if you’re NOT… you or canonical will need to track down who that was and the status of the charm project if I am not wrong

did you try deploying by modifying your bundle?

if you had the name for a project

cs:my-cool-charm … if the author published to charmhub correctly you would now do

juju deploy my-cool-charm instead of juju deploy cs:my-cool-charm … then and only then will you get the charm from the new charmhub… I believe

EDIT: in fact I see your app here Deploy Rabbitmq Server using Charmhub - The Open Operator Collection

notice it cites juju deploy rabbitmq-server so you simply need to modify your bundle yaml files to that new name… sans cs:----

Thx but you didn’t understand my issue.

I am not a Charm developper, I am an end user who already have bundles deployed with juju but this deployment refers to cs: and not (without the “cs:” prefix) and I would like to know if there is a way to upgrade this deployment so that it refers to non “cs:” prefixed charms without the need to redeploy.

RabbitMQ here is just an example but basically, this is part of a whole Openstack cluster with dozens of charms and I’d rather not need to redeploy to switch to charmhub.

1 Like

ahhhh got ya… yeah gotta wait for a canonical dev to answer that I guess… sorry about the mixup

The cutover to CharmHub is happening today, so I wouldn’t expect anything to have happened until later on today.

That said, you can switch manually by running the following:

juju upgrade-charm --switch rabbitmq-server rabbitmq-server

That command translates as “upgrade the application named rabbitmq-server with the rabbitmq-server charm from the default source.”

Again, that all should Just Work later on today, with no switch operation needed. I’d hold off on further troubleshooting until tomorrow.

2 Likes

Great ! I didn’t mean to offense, I didn’t knew about the --switch option, good to know ! I’ll try that, thanks !

1 Like

Ok, first feedbacks when trying to migrate to Charmhub … Well, not that great to say the least. Right now, I switched just a few Charms from charmstore to charmhub with this kind of command “juju upgrade-charm --switch cs:app” and I had many difficulties with at least these 2 ones (I’m stopping right now, I don’t want to break my cluster completely) :

  • hacluster : python issues, it relies on /usr/bin/python to exist but it doesn’t (there is python2 and python3 but not “python”) and I don’t know if it asks for python2 or 3, I tried both, had different behaviors but none worked for the upgrade. However, with a fresh install, it worked properly

  • ceph-mon: python mismatch either, relying on “python” to be declared but only python2 or python3 available. Seem to be python2 though because it worked when I created the /usr/bin/python -> python2 symlink. It also tries to install packages that are not present in the repository, at least, not the good name so I suppose it is targeted at another Ubuntu distro than mine (which is focal). Got it working by hacking the code to call the proper package names like “python3-ceph”, “btrfs-progs”, … instead of “python-ceph” and “btrfs-tools”.

I’m stopping my experiments now, don’t want to break more things and just fix what is already broken. I didn’t tried to re-deploy my bundle from scratch with charmhub names but upgrading is not what I expected, I have the impression that some charms on charmhub are not up to date with the ones on charmstore (at least the 2 I was talking about).

Best regards

okay … so, upgrade-charm failed miserably, I had to force remove the ceph-mon application first. Re-deploying Charmhub/ceph-mon from scratch did work without issue however.

So to summurize : deploying Charmhub Charms from scratch works but don’t try to switch an old deployment.

I’m sorry to hear that things did not work out with --switch. I am glad to hear that you proceeded cautiously, and had a way to roll back.

One pitfall with --switch is that Juju can’t perform some of the sanity checks that it performs with a standard upgrade. If you upgrade with --switch, you are telling Juju to trust that the charm that you’re asking it to switch to is basically the same charm, albeit possibly from a different source. In the case of rabbitmq-server, this is true. Everything works just fine. In the case of some of the older charms in CharmStore, this might not be true. If the charm was written for older Ubuntu distros, where python 2 was still available, for example, you’ll run into problems like those that you ran into.

The good news is that CharmHub contains a “shim” that allows you to continue to access the old CharmStore charms. If you do nothing, your controller will continue to point at the CharmStore, and you can evaluate how to bring the charms over to CharmHub over time.