Image Description for Google Compute Engine
A virtual disk image that is able to boot in the Google Compute Engine cloud framework has to comply with the following constraints:
KIWI NG type must be an expandable disk.
Google Compute Engine init must be installed.
Disk size must be set to 10G.
Kernel parameters must allow for a serial console.
To meet these requirements, update the KIWI NG image description as follows:
Software packages
Make sure to add the following packages to the package list:
Note
Package names used in the following list match the package names of the SUSE distribution and might be different on other distributions.
<package name="google-compute-engine-init"/>
Image Type definition
To allow the image to be expanded to the configured disk geometry of the instance started by Google Compute Engine, it is suggested to let KIWI NG’s OEM boot code take over that task. It would also be possible to try cloud-init’s resize module, but we found conflicts when two cloud-init systems,
google-compute-engine-initandcloud-init, were used together. Thus, for now, we stick with KIWI NG’s boot code, which can resize the disk from within the initrd before the system is activated through systemd.Update the oem image type setup to be changed into an expandable type as follows:
<type image="oem" initrd_system="dracut" filesystem="ext4" kernelcmdline="console=ttyS0,38400n8 net.ifnames=0" format="gce"> <bootloader name="grub2" timeout="1"/> <size unit="M">10240</size> <oemconfig> <oem-resize>true</oem-resize> <oem-swap>false</oem-swap> </oemconfig> </type>
An image built with the above setup can be uploaded into the
Google Compute Engine cloud and registered as an image. For further information
on how to upload to Google, see: google-cloud-sdk on software.opensuse.org.