4.15. Appendix - Building Red Hat Gluster Storage Compute Engine Image from Scratch It is possible to deploy an existing Red Hat Enterprise Linux public image and perform a layered install of Red Hat Gluster Storage. This creates an effective "double charge" for each Red Hat Enterprise Linux instance. Note Google Compute Engine charges a premium fee for using a public Red Hat Enterprise Linux image for instances in order to cover the expense of the Red Hat subscription. When deploying a layered install, you must re-register the instances with Red Hat Subscription Manager, thus consuming a Red Hat Enterprise Linux entitlement that you have paid for separately. After registering with Subscription Manager, however, Google Compute Engine will continue to charge the premium fee for the instances. To avoid this, we will build a custom image, which will not be subject to the Google Compute Engine premium fee. For infomration on building a custom image from scratch, see https://cloud.google.com/compute/docs/tutorials/building-images . 4.15.1. Installing Red Hat Gluster Storage from the ISO to a RAW Disk Image File Using your local virtualization manager, create a virtual machine with a RAW format sparse flat-file backing the system disk. The suggested minimum disk size for the Red Hat Gluster Storage 3.4 (and later) system disk is 20 GB and the maximum disk size for import into Google Compute Engine is 100 GB. Google Compute Engine additionally requires the disk size be in whole GB increments, that is, 20 GB or 21 GB, but not 20.5 GB. The RAW disk file should have the disk.raw file name. The disk.raw file must include an MS-DOS (MBR) partition table. For example, run the following dd command to create a 20 GB sparse file to serve as the RAW disk image: Refer to the Google Compute Engine Hardware Manifest guide at https://cloud.google.com/compute/docs/tutorials/building-images#hardwaremanifest to ensure your virtual machine image is compatible with the Google Compute Engine platform. Note The steps below assumes KVM/QEMU as your local virtualization platform. Attach the Red Hat Gluster Storage ISO, available from the Red Hat Customer Portal, as a bootable CD-ROM device to the image. Boot the VM to the ISO, and perform the installation of Red Hat Gluster Storage according to the instructions available in the Red Hat Gluster Storage 3.5 Installation Guide . 4.15.2. Enabling and Starting the Network Interface To enable and start the network interface: Enable the default eth0 network interface at boot time: Start the eth0 network interface: 4.15.3. Subscribing to the Red Hat Gluster Storage Server Channels You must register the system and enable the required channels for Red Hat Gluster Storage. For information on subscribing and connecting to the appropriate pool and repositories, refer to the Installing Red Hat Gluster Storagechapter in the Red Hat Gluster Storage 3.5 Installation Guide . . 4.15.4. Updating your System Update your systems using the following command: 4.15.5. Tuning and Miscellaneous Configuration Set the tuned profile to rhgs-sequential-io using the following command: Note The rhgs-sequential-io profile is appropriate for this environment, but the rhgs-random-io profile may be more appropriate for different workloads. Disable SElinux: If SELinux support is required, refer to the Enabling SELinux chapter in the Red Hat Gluster Storage 3.5 Installation Guide . 4.15.6. Customizing the Virtual Machine for Google Compute Engine The Google Compute Engine's "Build a Compute Engine Image from Scratch" documentation includes specific instructions for configuring the kernel, network, packages, SSH, and security of the virtual machine. It is recommended that you reference this documentation directly for updated information to ensure compatibility of your image with Google Compute Engine. Power off the instance to apply all changes and prepare the image import:

Commands:
dd if=/dev/zero of=disk.raw bs=1 count=0 seek=20G
sed -i s/ONBOOT=no/ONBOOT=yes/ /etc/sysconfig/network-scripts/ifcfg-eth0
ifup eth0
yum -y update
tuned-adm profile rhgs-sequential-io
setenforce 0
init 0