Upgrade from 0.32 to 1.2



  • Hi,
    Upgrading from 0.32 to 1.2, it is well known usually that the fact that the OS is stored in the image info rather than the host will be an issue, but there is a function handling that in the schema updater. Problem is, I got all my images set with OSID 0… I’ll debug more about that, but I wonder why this wasn’t done in SQL rather than having to call some PHP like this (we’re talking schema upgrade 29).

    Here’s an example that tries to link the images with the OS of the host that was the last to finish a imaging task.

    UPDATE images
    SET imageOSID = (
    [INDENT=1]SELECT DISTINCT hostOS[/INDENT]
    [INDENT=1]FROM hosts LEFT JOIN imagingLog ON (imagingLog.ilHostID = hosts.hostID)[/INDENT]
    [INDENT=1]WHERE hosts.hostImage = images.imageID[/INDENT]
    [INDENT=1]ORDER BY ilFinishTime DESC[/INDENT]
    [INDENT=1])[/INDENT]
    WHERE imageOSID = 0

    And that works, if you apply it before deleting the hostOS, whereas the PHP code leaves the images set to 0 for imageOSID…


  • Moderator



  • the “And new things, now my hosts don’t appear in the list, great… They do in the report, but because of the MACs, it seems they won’t get displayed…” one was due to me using a schema from SVN when I tried to pinpoint the problem. But the schema updater thing I reported first was consistent… But I’d need to try again on an old .32 file to see it happening… I haven’t kept all those :)


  • Senior Developer

    So this problem really isn’t/wasn’t a problem?



  • OK, that’s my fault, I used the schema updater from SVN in the end… not clever.



  • And new things, now my hosts don’t appear in the list, great… They do in the report, but because of the MACs, it seems they won’t get displayed…



  • And another bug (we need a mailing list, or a bug tracker):
    all my upgrades were configured as: “DHCP will NOT be setup but you must setup your…”

    And the process overwrote the config (backing them up before doing so, but still, annoying.)



  • I can’t really figure why the ->save() doesn’t work, so here’s the patch to make it work using pure SQL.

    [url="/_imported_xf_attachments/1/1496_schemav29.patch.txt?:"]schemav29.patch.txt[/url]



  • This post is deleted!

Log in to reply
 

450
Online

39.3k
Users

11.0k
Topics

104.6k
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.