Description of problem: Facts in candlepin database is limited to 255 characters. virt-who stores list of UUIDs of virtual machines in the fact virt.guests. More then 6 virtual guests present means that list of UUIDs is longer then 255 characters and can't be written to database. How reproducible: Try to store fact longer than 255 characters to candlepin database (run virt-who with more then 6 virtual guests) Actual results: rhsm.connection.RestlibException: Runtime Error could not insert collection: [org.fedoraproject.candlepin.model.Consumer.facts#8a90f8c6325fd85c013262a532911990] at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError:2,598 Expected results: Fact is successfully written to database.
Radek, There are some technical limitations on the length of facts, like DB column length. Instead, given the number of UUIDs that might be reported by a host, we made a new rest call for reporting guest UUIDs associated with a consumer. The change to virt-who should be relatively straightforward, and will avoid some of the issues we ran into when using facts (for example, https://bugzilla.redhat.com/show_bug.cgi?id=738678). The new calls are as such: get a list of all UUIDs: GET /consumers/#{consumer_id}/guests add a UUID to a consumer: PUT /consumers/#{consumer_id}/guests/#{guest_id} remove a UUID from a consumer: DELETE /consumers/#{consumer_id}/guests/#{guest_id} If you need more info, we can supply a patch for virt-who to alter it for the new calls, just let us know.
Chris, is this feature already implemented? I doesn't work for me with current master branch from git on fedorahosted.
Try again, It just got pushed a few minutes ago. hash is a6fcfb08cf32ce128c41caf85d578bf0ada4aea6
We've been discussing this afternoon, we're thinking that an explicit add/remove is going to be too error prone and easy to miss an event. We'd like to switch to pushing the entire list instead on each update. Additionally I was wondering if virt-who will only do this when it detects an added/removed guest? Should/can it also do this periodically? We were wondering about he risk of a missed add/remove event somehow, and if we should also mix in a periodic update as well. (if not virt-who, then perhaps by subscription-manager, who would get the list of guests from virt-who) Thoughts?
virt-who has 3 modes of running: 1) get list of guests, send them to candlepin and exit 2) on system with libvirt (not available with vdsm) it can listen for guest events (add/remove) and send only when needed 3) send guest list in specified interval Since virt-who can run in 1) mode, it always reads the list of guest UUIDs from candlepin before updating it. When there is no change, no update is send. If some add/remove event get lost somehow, in mode 2) next update can take very long time (until some libvirt event happens).
Which would you prefer as the most resilient and easiest to work with on our end: - Add/Remove one guest ID at a time. - Submit entire guest ID list. (whenever we detect add/remove events, or at an interval)
9fbbe091c23f35c7782cf31f892ed5ea0159ae11 master 0.97.2+ 75c647a RHEL6.2 0.97.13+
in order to test this, you can do a PUT call to the consumer resource with the following (any UUIDs will work): {"guestIds": ["53dddf75-9aba-bb66-ee79-fca18a0406aa", "58cb255e-2707-8ef3-4913-405bb4b7e58e", "7700b88b-561d-3eaa-2a6c-dd774612ac30", "86e9f8cc-95f5-8a8e-5f19-ca0e2da1f1e4", "cec855c2-6eb3-c7a6-831f-2339db1b7c92"]} Then, you should see the UUIDs in cp_consumer_guest table.
Due to dev design change, the appropriate component for this bug is entitlements/candlepin since this is now all a Candlepin API call (not python-rhsm nor subscription-manager). changing now component now... move to MODIFIED/ON_QA when the code gets merged to candlpin master. I'm told it is currently in wottop-virt-guest branch.
The patch for virt-who is ready, just waiting for exception+. Bug: https://bugzilla.redhat.com/show_bug.cgi?id=743823
Hi, candlepin has only "PUT /consumers/{consumer_uuid}/guests/{guest_uuid}" REST API define. However, python-rhsm's current code doesn't match it. Is there any plan to update it? //candlepin $ git show a6fcfb08cf32ce128c41caf85d578bf0ada4aea6 + @PUT + @Path("/{consumer_uuid}/guests/{guest_uuid}") + public void addGuest( + @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid, + @PathParam("guest_uuid") String guestId) { + if (guestId == null) { + throw new BadRequestException(i18n.tr("You must supply a guest UUID")); + } + Consumer consumer = verifyAndLookupConsumer(consumerUuid); + consumer.addGuestId(guestId); + consumerCurator.merge(consumer); + } //python-rhsm //connection.py def updateConsumer(self, uuid, facts=None, installed_products=None, guest_uuids=None): """ Update a consumer on the server. Rather than requiring a full representation of the consumer, only some information is passed depending on what we wish to update. Note that installed_products and guest_uuids expects a certain format, example parsing is in subscription-manager's format_for_server() method. """ params = {} if installed_products != None: params['installedProducts'] = installed_products if guest_uuids != None: params['guestIds'] = guest_uuids if facts != None: params['facts'] = facts method = "/consumers/%s" % self.sanitize(uuid) ret = self.conn.request_put(method, params) return ret
There has been some design change. "PUT /consumers/{consumer_uuid}/guests/{guest_uuid}" is old and is removed in wottop-virt-guest branch. Guests will be added via the updateConsumer Candlepin API call.
OK. virt-who functional testing then have to wait till the code is merged into master and pushed to stage env.
Marking all community bugs modified or beyong as closed.