docs/cloud-images.md
1b110fc8
 #Compatible Cloud Images
bdb137b4
 
e70c139c
 The [Bintray website](https://bintray.com/vmware/photon/) contains the following cloud-ready images of Photon OS: 
aab48f13
 
e70c139c
 1. GCE - Google Compute Engine
aab48f13
 
e70c139c
 1. AMI - Amazon Machine Image
aab48f13
 
e70c139c
 1. OVA
aab48f13
 
e70c139c
 Because the cloud-ready images of Photon OS are built to be compatible with their corresponding cloud platform or format, you typically do not need to build a cloud image--just go to Bintray and download the image for the platform that you are working on. 
bdb137b4
 
e70c139c
 If, however, you want to build your own cloud image, perhaps because you seek to customize the code, see the next section on how to build cloud images.
bdb137b4
 
e70c139c
 ## How to build cloud images
bdb137b4
 
e70c139c
 	sudo make cloud-image IMG_NAME=image-name
 
 	image-name: gce/ami/azure/ova
bdb137b4
 
 The output of the build process produces the following file formats:
f311d1bc
 
bdb137b4
 GCE - A tar file consisting of disk.raw as the raw disk file 
f311d1bc
 
bdb137b4
 AMI - A raw disk file
f311d1bc
 
e70c139c
 <!-- Azure - A vhd file -->
f311d1bc
 
bdb137b4
 OVA - An ova file (vmdk + ovf)
 
e70c139c
 If you want, you can build all the cloud images by running the following command: 
 
 	sudo make cloud-image-all 
bdb137b4
 
e70c139c
 <!-- ###How to build Photon bosh-stemcell
4afc638f
 
e70c139c
 Please follow the link to [build](https://github.com/cloudfoundry/bosh/blob/develop/bosh-stemcell/README.md) Photon bosh-stemcell
 -->
4afc638f
 
e70c139c
 ## How to create running instances in the cloud
bdb137b4
 
e70c139c
 The following sections contain some high-level instructions on how to create instances of Photon OS in the Google Compute Engine (GCE) and Amazon Elastic Cloud Compute (EC2). For more information, see the Amazon or Google cloud documentation. 
bdb137b4
 
e70c139c
 ### GCE
bdb137b4
 
e70c139c
 The tar file can be uploaded to Google's cloud storage and an instance can be created after creating an image from the tar file. You will need the Google Cloud SDK on your host machine to upload the image and create instances.
bdb137b4
 
e70c139c
 ####Install Google cloud SDK on host machine
bdb137b4
 
e70c139c
 	curl https://sdk.cloud.google.com | bash
bdb137b4
 
f311d1bc
 ####Upload the tar file
e70c139c
 
 	gsutil cp photon-gce.tar.gz gs://bucket-name
bdb137b4
 
f311d1bc
 ####Create image
e70c139c
 
 	gcloud compute --project project-id images create image-name --description description --source-uri https://storage.googleapis.com/bucket-name/photon-gce.tar.gz
bdb137b4
 
f311d1bc
 ####Create instance of GCE
bdb137b4
 
e70c139c
 	gcloud compute --project project-id instances create instance-name --zone "us-central1-f" --machine-type "n1-standard-1" other-options
bdb137b4
 
e70c139c
 (You can also create instances from the Google developer console.)
bdb137b4
 
1b110fc8
 For more information, see [Running a Photon OS Machine on GCE](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md#running-a-photon-os-machine-on-gce). 
bdb137b4
 
e70c139c
 ### AWS EC2
 
 Install the [AWS CLI](http://docs.aws.amazon.com/cli/latest/userguide/installing.html#install-bundle-other-os) and [EC2 CLI](http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/set-up-ec2-cli-linux.html) tools. 
bdb137b4
 
f311d1bc
 ####Bundle the image
e70c139c
 
 	ec2-bundle-image -c cert.pem -k private-key.pem -u $AWS_USER_ID --arch x86_64 --image photon-ami.raw --destination directory-name
bdb137b4
 
f311d1bc
 ####Upload the bundle
e70c139c
 
 	ec2-upload-bundle --manifest directory-name/photon-ami.raw.manifest.xml --bucket bucket-name --access-key $AWS_ACCESS_KEY --secret-key $AWS_SECRET_KEY
 
f311d1bc
 ####Register the AMI
bdb137b4
 
e70c139c
 	ec2-register bucket-name/photon-ami.raw.manifest.xml --name name --architecture x86_64 --virtualization-type hvm
bdb137b4
 
e70c139c
 You can now launch instances using the AWS console.
bdb137b4
 
1b110fc8
 For more information, see [Customizing a Photon OS Machine on EC2](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md#customizing-a-photon-os-machine-on-ec2).
e70c139c
 
 
 <!--
f311d1bc
 ##AZURE
 
 Install the [Azure CLI] (https://www.npmjs.com/package/azure)
 
 Install [QEMU](https://en.wikibooks.org/wiki/QEMU/Installing_QEMU)
bdb137b4
 
f311d1bc
 ####Create the image
 azure vm image create image_name path_to_vhd -l "West US" -o linux
bdb137b4
 
 Create running VM instances using Azure management portal
e70c139c
 -->
bdb137b4
 
e70c139c
 ###OVA
bdb137b4
 
e70c139c
 The OVA image uses an optimized version of the 4.4.8 Linux kernel. Two ova files are generated from the build: photon-ova.ova, which is the full version of Photon OS, and photon-custom.ova, which is the minimal version of Photon OS. The password for photon-ova.ova should be changed using guest customization options when you upload it to VMware vCenter. Photon-custom.ova comes with the default password set to `changeme`; you must change it the first time you log in.
f311d1bc
 
e70c139c
 #### OVA Prerequisites
f311d1bc
 
e70c139c
 [VDDK 6.0](https://developercenter.vmware.com/web/sdk/60/vddk)
f311d1bc
 
f0119cdc
 To utilize the VDDK libraries the following procedure may be used, this extracts the libraries and temporarily exports them to the LD_LIBRARY_PATH for the *current session*.  (tested on Ubuntu 1404 & 1604)  If you wish to make this permenant and system-wide then you may want to create a config file in /etc/ld.so.conf.d/.
 
     tar -zxf VMware-vix-disklib-6.0.2-3566099.x86_64.tar.gz
     cp -r vmware-vix-disklib-distrib/include/* /usr/include/
     mkdir /usr/lib/vmware
     cp -a ~/vmware-vix-disklib-distrib/lib64/* /usr/lib/vmware/
     rm /usr/lib/vmware/libstdc++.so.6
     export LD_LIBRARY_PATH=/usr/lib/vmware
bdb137b4
 
e70c139c
 [OVFTOOL](https://my.vmware.com/group/vmware/details?downloadGroup=OVFTOOL410&productId=491)
bdb137b4
 
f0119cdc
 OVF Tool should be downloaded and installed on the host.
 
     sh VMware-ovftool-4.1.0-2459827-lin.x86_64.bundle --eulas-agreed --required
 
e70c139c
 <!-- 
4afc638f
 ##Photon Bosh
 
 Please refer [bosh docs] (http://bosh.io/docs) to deploy BOSH on Photon 
e70c139c
 -->
bdb137b4
 
6e0aa8ba
 
698ae648