Change-Id: I6359f1fa57294d7649cf7d6b527a408c3303cff8
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/1303
Reviewed-by: Steve Hoenisch <shoenisch@vmware.com>
Tested-by: Steve Hoenisch <shoenisch@vmware.com>
... | ... |
@@ -207,12 +207,12 @@ This section demonstrates how to create a virtual machine running Photon OS in V |
207 | 207 |
1. Select `Installer disk image file (iso)`, click `Browse` to locate the Photon OS ISO that you downloaded from Bintray, and then click `Next`. |
208 | 208 |
|
209 | 209 |
1. For the guest operating system, select `Linux`. From the `Version` drop-down menu, select `VMware Photon 64-bit`. If you have an older version of VMware Workstation and Photon does not appear in the list, select `Other Linux 3.x kernel 64-bit`. |
210 |
-![Alt text](images/ws-new-vm.png) |
|
210 |
+![VMware Photon](images/ws-new-vm.png) |
|
211 | 211 |
|
212 | 212 |
1. Click `Next` through the remaining dialog boxes of the wizard, either accepting the default settings, which is recommended, or making the changes that you want, and then click `Finish`. |
213 | 213 |
|
214 | 214 |
1. Power on the virtual machine and, in the Workstation window containing Photon, press Enter to start the installation. |
215 |
-![installer](images/photon-installer-sm.png) |
|
215 |
+![Installer](images/photon-installer-sm.png) |
|
216 | 216 |
|
217 | 217 |
1. During disk setup, the installer might ask you to confirm that this will erase the disk. If so, accept the default value of `yes` by hitting your Enter key. |
218 | 218 |
|
... | ... |
@@ -254,11 +254,11 @@ In Firefox, download the OVA for the minimal version of Photon OS from this URL: |
254 | 254 |
|
255 | 255 |
In the download dialog box, select `Open with VMware Workstation (default)`, like this: |
256 | 256 |
|
257 |
-![Alt text](images/ova-firefox.png) |
|
257 |
+![Firefox Dialogue Box](images/ova-firefox.png) |
|
258 | 258 |
|
259 | 259 |
In the Workstation Import dialog box, click Import. |
260 | 260 |
|
261 |
-![Alt text](images/ova-import.png) |
|
261 |
+![Import virtual machine](images/ova-import.png) |
|
262 | 262 |
|
263 | 263 |
Workstation creates a virtual machine from the Photon OS OVA template in a few seconds. In Workstation, power on the virtual machine and log in as root with the initial password of `changeme`. |
264 | 264 |
|
... | ... |
@@ -1377,59 +1377,67 @@ Finally, attach the ISO to the Photon OS virtual machine as a CD-ROM and reboot |
1377 | 1377 |
|
1378 | 1378 |
### Customizing a Photon OS Machine on EC2 |
1379 | 1379 |
|
1380 |
-This section shows you how to upload an `ami` image of Photon OS to Amazon Elastic Compute Cloud, or EC2, and customize the Photon OS machine by using cloud-init with an EC2 data source. The ami version of Photon OS is available as a free download on Bintray: |
|
1380 |
+This section illustrates how to upload an `ami` image of Photon OS to Amazon Elastic Compute Cloud (EC2) and customize the Photon OS machine by using cloud-init with an EC2 data source. The ami version of Photon OS is available as a free download on Bintray: |
|
1381 | 1381 |
|
1382 | 1382 |
https://bintray.com/vmware/photon/ |
1383 | 1383 |
|
1384 |
-The cloud-init service is commonly used on EC2 to configure the cloud instance of a Linux image. On EC2, for example, cloud-init typically sets the `.ssh/authorized_keys` file to let you log in with a private key. The cloud-config user-data file that appears in the following example contains abridged SSH authorized keys to show you how to set them for an instance of Photon OS in the Amazon cloud. |
|
1384 |
+The cloud-init service is commonly used on EC2 to configure the cloud instance of a Linux image. On EC2, for example, cloud-init typically sets the `.ssh/authorized_keys` file to let you log in with a private key from another computer--that is, a computer besides the workstation that you are already using to connect with the Amazon cloud. The cloud-config user-data file that appears in the following example contains abridged SSH authorized keys to show you how to set them. |
|
1385 | 1385 |
|
1386 |
-Working with EC2 requires Amazon accounts for both AWS and EC2 with valid payment information. If you execute the following examples, you will be charged by Amazon. You will need to replace the placeholders for access keys and other account information in the examples with your account information. |
|
1386 |
+Working with EC2 requires Amazon accounts for both AWS and EC2 with valid payment information. If you execute the following examples, you will be charged by Amazon. You will need to replace the `<placeholders>` for access keys and other account information in the examples with your account information. |
|
1387 | 1387 |
|
1388 |
-The following code assumes you have installed and set up the Amazon AWS CLI and the EC2 CLI tools. See [Installing the AWS Command Line Interface](http://docs.aws.amazon.com/cli/latest/userguide/installing.html) and [Setting Up the Amazon EC2 Command Line Interface Tools on Linux](http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/set-up-ec2-cli-linux.html). |
|
1388 |
+The following code assumes you have installed and set up the Amazon AWS CLI and the EC2 CLI tools, including `ec2-ami-tools`. See [Installing the AWS Command Line Interface](http://docs.aws.amazon.com/cli/latest/userguide/installing.html) and [Setting Up the Amazon EC2 Command Line Interface Tools on Linux](http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/set-up-ec2-cli-linux.html). Also see [Setting Up the AMI Tools](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-up-ami-tools.html). |
|
1389 | 1389 |
|
1390 |
-Here's a code example that shows how to upload the Photon OS `.ami` image to the Amazon cloud and configure it with cloud-init: |
|
1390 |
+EC2 requires an SSH key and an RSA certificate. The code in the examples assumes that you have created SSH keys as well as an RSA user signing certificate and its corresponding private RSA key file. |
|
1391 |
+ |
|
1392 |
+Here's a code example that shows how to upload the Photon OS `.ami` image to the Amazon cloud and configure it with cloud-init. The correct virtualization type for Photon OS is `hvm`. |
|
1391 | 1393 |
|
1392 | 1394 |
$ mkdir bundled |
1393 | 1395 |
$ tar -zxvf ./photon-ami.tar.gz |
1394 |
- $ ec2-bundle-image -c ec2-cert.pem -k ec2-pk.pem -u <EC2 account id> --arch x86_64 --image photon-ami.raw --destination ./bundled/ |
|
1396 |
+ $ ec2-bundle-image -c ec2-certificate.pem -k ec2-privatekey.pem -u <EC2 account id> --arch x86_64 --image photon-ami.raw --destination ./bundled/ |
|
1395 | 1397 |
$ aws s3 mb s3://<bucket-name> |
1396 | 1398 |
$ ec2-upload-bundle --manifest ./bundled/photon-ami.manifest.xml --bucket <bucket-name> --access-key <Account Access Key> --secret-key <Account Secret key> |
1397 | 1399 |
$ ec2-register <bucket-name>/photon-ami.manifest.xml --name photon-ami --architecture x86_64 --virtualization-type hvm |
1398 | 1400 |
|
1399 |
-In the following command, the `--user-data-file` option instructs cloud-init to import the cloud-config data in `user-data.txt`. The next command assumes you have created the keypair aws.pem and the group ami-validation as well as uploaded the user-data.txt file to the right place in the Amazon cloud; see the EC2 documentation. |
|
1401 |
+In the following command, the `--user-data-file` option instructs cloud-init to import the cloud-config data in `user-data.txt`. The next command assumes you have created the keypair called `mykeypair` and the security group photon-sg as well as uploaded the user-data.txt file; see the EC2 documentation. |
|
1402 |
+ |
|
1403 |
+ $ ec2-run-instances <ami-ID> --instance-type m3.medium -g photon-sg --key mykeypair --user-data-file user-data.txt |
|
1404 |
+ |
|
1405 |
+You can now describe the instance to see its ID: |
|
1400 | 1406 |
|
1401 |
- $ ec2-run-instances $AMI_ID -t m3.medium -k aws -g ami-validation --user-data-file user-data.txt |
|
1402 | 1407 |
$ ec2-describe-instances |
1403 |
- $ aws ec2 describe-instances --instance-ids "+instance_id+" --query \"Reservations[*].Instances[*].PublicIpAddress\" --output=text |
|
1408 |
+ |
|
1409 |
+And you can run the following command to obtain its public IP address, which you can use to connect to the instance with SSH: |
|
1410 |
+ |
|
1411 |
+ $ aws ec2 describe-instances --instance-ids <instance-id> --query 'Reservations[*].Instances[*].PublicIpAddress' --output=text |
|
1404 | 1412 |
$ ec2-describe-images |
1405 | 1413 |
|
1406 |
-**Important**: When you are done, run the following commands to terminate the machine. Because Amazon charges you while the host is running, make sure to shut it down, replacing the example instance ID in the second command with the ID of your instance: |
|
1407 |
- |
|
1408 |
- $ ec2-deregister ami-18956278 |
|
1409 |
- $ ec2-terminate-instances i-0920384095842eccf |
|
1410 |
- |
|
1411 |
-Here is the contents of the user-data.txt file that cloud-init applies to the machine the first time that it boots up in the cloud: |
|
1412 |
- |
|
1413 |
- /#cloud-config |
|
1414 |
- hostname: photon-on-01 |
|
1415 |
- groups: |
|
1416 |
- - cloud-admins |
|
1417 |
- - cloud-users |
|
1418 |
- users: |
|
1419 |
- - default |
|
1420 |
- - name: photonadmin |
|
1421 |
- gecos: photon test admin user |
|
1422 |
- primary-group: cloud-admins |
|
1423 |
- groups: cloud-users |
|
1424 |
- lock-passwd: false |
|
1425 |
- passwd: vmware |
|
1426 |
- - name: photonuser |
|
1427 |
- gecos: photon test user |
|
1428 |
- primary-group: cloud-users |
|
1429 |
- groups: users |
|
1430 |
- passwd: vmware |
|
1431 |
- packages: |
|
1432 |
- - vim |
|
1414 |
+**Important**: When you are done, run the following commands to terminate the machine. Because Amazon charges you while the host is running, make sure to shut it down: |
|
1415 |
+ |
|
1416 |
+ $ ec2-deregister <ami-image-identifier> |
|
1417 |
+ $ ec2-terminate-instances <instance-id> |
|
1418 |
+ |
|
1419 |
+Here are the contents of the user-data.txt file that cloud-init applies to the machine the first time that it boots up in the cloud: |
|
1420 |
+ |
|
1421 |
+ #cloud-config |
|
1422 |
+ hostname: photon-on-01 |
|
1423 |
+ groups: |
|
1424 |
+ - cloud-admins |
|
1425 |
+ - cloud-users |
|
1426 |
+ users: |
|
1427 |
+ - default |
|
1428 |
+ - name: photonadmin |
|
1429 |
+ gecos: photon test admin user |
|
1430 |
+ primary-group: cloud-admins |
|
1431 |
+ groups: cloud-users |
|
1432 |
+ lock-passwd: false |
|
1433 |
+ passwd: vmware |
|
1434 |
+ - name: photonuser |
|
1435 |
+ gecos: photon test user |
|
1436 |
+ primary-group: cloud-users |
|
1437 |
+ groups: users |
|
1438 |
+ passwd: vmware |
|
1439 |
+ packages: |
|
1440 |
+ - vim |
|
1433 | 1441 |
ssh_authorized_keys: |
1434 | 1442 |
- ssh-rsa MIIEogIBAAKCAQEAuvHKAjBhpwuomcUTpIzJWRJAe71JyBgAWrwqyN1Mk5N+c9X5 |
1435 | 1443 |
Ru2fazFA7WxQSD1KyTEvcuf8JzdBfrEJ0v3/nT2x63pvJ8fCl6HRkZtHo8zRu8vY |
... | ... |
@@ -1854,3 +1862,6 @@ The following technical articles and guides appear in the [Photon OS wiki](https |
1854 | 1854 |
|
1855 | 1855 |
|
1856 | 1856 |
|
1857 |
+ |
|
1858 |
+ |
|
1859 |
+ |