| 1 |
.. _setup_for_gce: |
| 2 |
|
| 3 |
Image Description for Google Compute Engine |
| 4 |
=========================================== |
| 5 |
|
| 6 |
.. sidebar:: Abstract |
| 7 |
|
| 8 |
This page provides further information for handling |
| 9 |
GCE images built with {kiwi} and references the following |
| 10 |
articles: |
| 11 |
|
| 12 |
* :ref:`simple_disk` |
| 13 |
|
| 14 |
A virtual disk image that is able to boot in the Google Compute Engine |
| 15 |
cloud framework has to comply with the following constraints: |
| 16 |
|
| 17 |
* {kiwi} type must be an expandable disk. |
| 18 |
* Google Compute Engine init must be installed. |
| 19 |
* Disk size must be set to 10G. |
| 20 |
* Kernel parameters must allow for a serial console. |
| 21 |
|
| 22 |
To meet these requirements, update the {kiwi} image |
| 23 |
description as follows: |
| 24 |
|
| 25 |
1. Software packages |
| 26 |
|
| 27 |
Make sure to add the following packages to the package list: |
| 28 |
|
| 29 |
.. note:: |
| 30 |
|
| 31 |
Package names used in the following list match the |
| 32 |
package names of the SUSE distribution and might be different |
| 33 |
on other distributions. |
| 34 |
|
| 35 |
.. code:: xml |
| 36 |
|
| 37 |
<package name="google-compute-engine-init"/> |
| 38 |
|
| 39 |
2. Image Type definition |
| 40 |
|
| 41 |
To allow the image to be expanded to the configured disk |
| 42 |
geometry of the instance started by Google Compute Engine, it is |
| 43 |
suggested to let {kiwi}'s OEM boot code take over that task. It would |
| 44 |
also be possible to try cloud-init's resize module, but we found |
| 45 |
conflicts when two cloud-init systems, `google-compute-engine-init` and |
| 46 |
`cloud-init`, were used together. Thus, for now, we stick with {kiwi}'s |
| 47 |
boot code, which can resize the disk from within the initrd before |
| 48 |
the system is activated through systemd. |
| 49 |
|
| 50 |
Update the oem image type setup to be changed into an expandable |
| 51 |
type as follows: |
| 52 |
|
| 53 |
.. code:: xml |
| 54 |
|
| 55 |
<type image="oem" |
| 56 |
initrd_system="dracut" |
| 57 |
filesystem="ext4" |
| 58 |
kernelcmdline="console=ttyS0,38400n8 net.ifnames=0" |
| 59 |
format="gce"> |
| 60 |
<bootloader name="grub2" timeout="1"/> |
| 61 |
<size unit="M">10240</size> |
| 62 |
<oemconfig> |
| 63 |
<oem-resize>true</oem-resize> |
| 64 |
<oem-swap>false</oem-swap> |
| 65 |
</oemconfig> |
| 66 |
</type> |
| 67 |
|
| 68 |
An image built with the above setup can be uploaded into the |
| 69 |
Google Compute Engine cloud and registered as an image. For further information |
| 70 |
on how to upload to Google, see: `google-cloud-sdk` on software.opensuse.org. |