[SOLVED] Move image to second node
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:
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
I have modified the storage group in my image definition.
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 :
I think it works but i waiting the end of deploy
After cp + rm
The final result:
For information, i don’t have used mysql. I can not use it anymore
Thank you one more again @george1421
@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.
@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
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
mvcommand. 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.
- Recreate the image definition by hand for each image you move.
- Export the image definitions, adjust the settings of the images that were moved and then reimport the image definitions.
- Edit the data directly in the mysql database (imageGroupAssoc table).
meits 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