[SOLVED] Move image to second node



  • Hello,

    I have 2 node in master mode.
    My first node is full and my second node is empty !
    I would like move images to node 1 for node 2.

    I think modify the storage group in image management and move all the file with the command:

    0_1500364166264_e5440-cfg.png

    mv /images/MyPc1 /images2/MyPc1
    chmod 777 -R /images2/MyPc1
    chown -R fog.root /images2/MyPc1 
    

    Does this solution work?

    Thanks for help and reply :D



  • @george1421

    I have modified the storage group in my image definition.
    I have:

    cp -R /images/Dellvostro430 /images2/
    sudo chmod 777 -R /images2/Dellvostro430
    sudo chown fog.root -R /images2/Dellvostro430/
    rm /images/Dellvostro430
    

    I have updated the configuration for my client with the image definition modified.

    And the result :

    0_1500383292579_vostro430.jpg

    I think it works but i waiting the end of deploy

    Edit:

    It works :D

    After cp + rm
    Node 1:
    0_1500383895890_1.jpg

    Node2:
    0_1500383908488_2.jpg

    The final result:
    0_1500383925687_3.jpg

    For information, i don’t have used mysql. I can not use it anymore

    Thank you one more again @george1421


  • Moderator

    @afaure All you need to know is the image id and storage management ID. This is easy to find if you are in the web managment. Just look at the browser address line when you are updating the record.

    0_1500380610193_is_change.png



  • @george1421 thank you :)

    I would like try the second option:

    For me its easier to just change the database record by hand since you only need to update one field with update imageGroupAssoc set igaStorageGroupID=<new_image_store_id> where igaImageID=<image_id>; Be sure if you are editing records directly in the database you backup the mysql database first

    I try and post the result ;)


  • Moderator

    Images in FOG have 2 parts. There is the raw data that is stored in, typically in /images and there is the meta data that is stored in the mysql database.

    You can move the data as you mentioned in your post with the mv command. Changing the mode is not necessary since it will take the mode of the files in the original location.

    Once the raw data files are moved then you just need to update your image definitions to point your image configuration to the new datastore. This is not as easy as just moving the raw data. The web gui has no facilities to change the image store group once the image definition has been saved. To change this setting you can do the following.

    1. Recreate the image definition by hand for each image you move.
    2. Export the image definitions, adjust the settings of the images that were moved and then reimport the image definitions.
    3. Edit the data directly in the mysql database (imageGroupAssoc table).

    For me its easier to just change the database record by hand since you only need to update one field with update imageGroupAssoc set igaStorageGroupID=<new_image_store_id> where igaImageID=<image_id>; Be sure if you are editing records directly in the database you backup the mysql database first


Log in to reply
 

434
Online

38938
Users

10697
Topics

101491
Posts

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