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.
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.
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).
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.