5. OpenStack will resize instance after start. Image shouldn't contain any empty partitions or free space
5. OpenStack will resize instance after start. Image shouldn't contain any empty partitions or free space
## Image sharing between projects
Image sharing allows you to share your image between different projects and then it is possible to launch instances from that image in those projects with other collaborators etc. As mentioned in section about CLI, you will need to use your OpenStack credentials from ```openrc``` or ```cloud.yaml``` file.
Then to share an image you need to know it's ID, which you can find with command:
```
openstack image show <name_of_image>
```
where ```name_of_image``` is name of image you want to share.
After that you will also have to know ID of project you want to share your image with. If you do not know ID of that project you can use following command, which can help you find it:
```
openstack project list | grep <name_of_other_project>
```
where ```<name_of_project>``` is name of other project. It's ID will show up in first column.
Now all with necessary IDs you can now share your image. First you need to set an attribute of image to `shared` by following command:
```
openstack image set --shared <image_ID>
```
And now you can share it with your project by typing this command:
By default VMs after creation do not have SWAP partition. If you need to add a SWAP file to your system you can download and run [script](https://gitlab.ics.muni.cz/cloud/cloud-tools/blob/master/swap.sh) that create SWAP file on your VM.
By default VMs after creation do not have SWAP partition. If you need to add a SWAP file to your system you can download and run [script](https://gitlab.ics.muni.cz/cloud/cloud-tools/blob/master/swap.sh) that create SWAP file on your VM.