Custom Search
Showing posts with label EC2. Show all posts
Showing posts with label EC2. Show all posts

Monday, July 15, 2013

How to Connect RDP to Imported EC2 Windows Instance

How to Connect Remote Desktop to Imported EC2 Windows Instance

1)
Prepare a Windows VM to import to Amazon EC2

http://fosshelp.blogspot.in/2013/07/prepare-windows-vm-import-amazon-ec2.html

2)
Download Vitual Machine from ESXi node in ovf format

#ovftool vi://root:welcome@192.168.12.154/windows_2003_server_32 windows_2003_server_32.ovf
3)
Create EC2 Instance using *.vmdk

#ec2-import-instance windows_2003_server_32-disk1.vmdk -f VMDK -t m1.small -a x86_64 -b import-export -o $AWS_ACCESS_KEY -w $AWS_SECRET_KEY --region us-west-1

4)
Check the Progress of the task

#ec2-describe-conversion-tasks import-i-ffm2nty0 -O $AWS_ACCESS_KEY -W $AWS_SECRET_KEY --region us-west-1

5)
Start Imported EC2 Instance


6)
Edit Security Group

* Add RDP Group Permission to "default" Security Group.
* Add ICMP Group Permission to "default" Security Group (Optional, For test Ping).

7)
Connect RDP to VM

#rdesktop ip-of-imported-ec2-instance

How to Prepare a Windows VM to import to Amazon EC2

1)
Create a VM and Install Windows 2003 Server
(I used Windows Server 2003 R2 Standard x32).

2)
Start Windows 2003 Server VM and Enable Remote Desktop.

Goto MyComputer --> Properties --> Remote --> (Select Check Box) Enable Remote Desktop on this computer.
3)
Find the IP of windows machine using the command "ipconfig" and check locally whether Remote Desktop (RDP) working or not, before importing the VM to EC2.
#rdesktop ip-of-windows-machine

4)
Shut-down the VM


5)
Import to Amazon EC2


6)
Security Group Settings
* Add RDP Group Permission to Security Group.
* Add ICMP Group Permission to Security Group (Optional, For test Ping).

7)
Connect to VM

#rdesktop ip-of-imported-ec2-instance

Thursday, July 11, 2013

How to Create a new Amazon EC2 AMI from VMware VM or VMDK file

1)
Download vmdk file from ESXi Server
#ovftool vi://root:welcome@192.168.12.154/sm_win3_test2 sm_win3_test2.ovf

2)
Export

export AWS_ACCESS_KEY=XXXXXXXXXXXXXXXX
export AWS_SECRET_KEY=XXXXXXXXXXXXXXXX
export AMS_USER_ID=4471-9218-2508


3)
Convert VMDK file to RAW

#qemu-img convert -O raw sm_win3_test2-disk1.vmdk  output.raw
4)
Bundle this RAW into an AMI using ec2-bundle-image

#ec2-bundle-image -i output.raw -r x86_64 -c cert-XXXXXXXXXXXXXXXX.pem -k pk-XXXXXXXXXXXXXXXX.pem --user $AMS_USER_ID

5)
#ls /tmp
#vim /tmp/output.raw.manifest.xml


6)
Upload the bundle to an S3 bucket.

#ec2-upload-bundle -b import_export -m /tmp/output.raw.manifest.xml -a $AWS_ACCESS_KEY -s $AWS_SECRET_KEY

7)
#ec2-describe-images

8)
Register the image

#ec2-register import_export/output.raw.manifest.xml

9)
The AMI should then appear when you request a list of your images.

#ec2-describe-images

Notes
====

1)
How to Upload the bundle to an S3 bucket in the us-west-1 region.
#ec2-upload-bundle -b import-export-us-west-1 -m /tmp/output.raw.manifest.xml -a $AWS_ACCESS_KEY -s $AWS_SECRET_KEY --location us-west-1


2)
How to Register the image in us-west-1 region.
#ec2-register import_export/output.raw.manifest.xml --region us-west-1


3)
How to describe images in the us-west-1 region.
#ec2-describe-images --region us-west-1

Wednesday, July 10, 2013

How to Install Amazon EC2 VM Import Connector Plugin for VMware vCenter

1)
Download the Amazon EC2 VM Import Connector for VMware vCenter OVA "Amazon-EC2-VM-Import-Connector.ova".
http://aws.amazon.com/developertools
http://aws.amazon.com/developertools/2759763385083070
https://s3.amazonaws.com/ec2-vm-import-connector-appliance/Amazon-EC2-VM-Import-Connector-1.2.0.ova

2)
Deploy the OVF Template and create a VM



3)
Power On the VM

4)
Open the Browser and goto the IP showing In the VM's Console and login.

5)
Register vCenter

6)
Open vSphere Client and Login to vCenter. Then Select a VM and in right side you can see a new Tab

Saturday, June 22, 2013

Thursday, June 20, 2013

How to download file from Amazon S3 to local system using ec2-download-bundle

1)
Export Aws Access and Secret keys
 
#export AWS_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXX
#export AWS_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXX

2)
Download the file "export-i-ffm3g49z.ova" from S3 to to Local System
#ec2-download-bundle -b import-export -m export-i-ffm3g49z.ova -a $AWS_ACCESS_KEY -s $AWS_SECRET_KEY -k pk-XXXXXXUPPXXXXXXXXXXX.pem -d local_system_down_dir

Note:
* Download "Primary_key" from your Amazon web console.
http://fosshelp.blogspot.in/2013/06/amazon-howto-download-x509-certificate.html

Wednesday, June 19, 2013

Amazon How to describe and cancel export tasks

Amazon How to describe and cancel export tasks using ec2-api-tools

1)
Export Aws Access and Secret keys

#export AWS_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXX
#export AWS_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXX

2)
Export EC2 Instance i-54a45a0f

#ec2-create-instance-export-task i-54a45a0f -e VMware -f VMDK -c ova -b import-export -O $AWS_ACCESS_KEY -W $AWS_SECRET_KEY --region us-west-1

3)
Optional

Error:
-----
Client.AuthFailure: vm-import-export@amazon.com must have WRITE and READ_ACL permission on the S3 bucket.

Fix:
----
Goto bucket "import-export" --> Properties --> Permissions --> Add More Permissions --> Grantee [vm-import-export@amazon.com], List[ok], Upload/Delete[ok], View Permissions[ok] --> save

4)
Describe Export Task

#ec2-describe-export-tasks -O $AWS_ACCESS_KEY -W $AWS_SECRET_KEY --region us-west-1

5)
Cancel Export Task

#ec2-cancel-export-task export-i-ffm3g49z -O $AWS_ACCESS_KEY -W $AWS_SECRET_KEY --region us-west-1

How to Import XEN Virtual Machine to Amazon EC2

How to Import XEN Virtual Machine to Amazon EC2

1)
Install ec2-api-tools_1.6
#wget http://launchpadlibrarian.net/111617788/ec2-api-tools_1.6.1.1-0ubuntu1_all.deb
#sudo dpkg -i ec2-api-tools_1.6.1.1-0ubuntu1_all.deb

2)
Check the Version of ec2-api-tools
#ec2-version
3)
Export Aws Access and Secret keys
#export AWS_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXX
#export AWS_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXX

4)
Create EC2 Instance using RAW Disk
#ec2-import-instance win2k-r2-disk1.xm -f RAW -t m1.small -a x86_64 -b import-export -o $AWS_ACCESS_KEY -w $AWS_SECRET_KEY --region us-west-1

5)
Check the Progress of the task
#ec2-describe-conversion-tasks import-i-ffm2nty0 -O $AWS_ACCESS_KEY -W $AWS_SECRET_KEY --region us-west-1

6)
Resume task
#ec2-resume-import win2k-r2-disk1.xm -t import-i-ffm2nty0 -o $AWS_ACCESS_KEY -w $AWS_SECRET_KEY --region us-west-1

7)
Remove the image from S3, when the task completed
#ec2-delete-disk-image -t import-i-ffm2nty0 -o $AWS_ACCESS_KEY -w $AWS_SECRET_KEY --region us-west-1

How to Import KVM Virtual Machine to Amazon EC2

How to Import KVM Virtual Machine to Amazon EC2

1)
Install ec2-api-tools_1.6
#wget http://launchpadlibrarian.net/111617788/ec2-api-tools_1.6.1.1-0ubuntu1_all.deb
#sudo dpkg -i ec2-api-tools_1.6.1.1-0ubuntu1_all.deb

2)
Check the Version of ec2-api-tools
#ec2-version
 3)
Export Aws Access and Secret keys
#export AWS_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXX
#export AWS_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXX

4)
Create EC2 Instance using RAW Disk
#ec2-import-instance win2k-r2-disk1.xm -f RAW -t m1.small -a x86_64 -b import-export -o $AWS_ACCESS_KEY -w $AWS_SECRET_KEY --region us-west-1 -g my_sec_group

5)
Check the Progress of the task
#ec2-describe-conversion-tasks import-i-ffm2nty0 -O $AWS_ACCESS_KEY -W $AWS_SECRET_KEY --region us-west-1

6)
Resume task
#ec2-resume-import win2k-r2-disk1.xm -t import-i-ffm2nty0 -o $AWS_ACCESS_KEY -w $AWS_SECRET_KEY --region us-west-1

7)
Remove the image from S3, when the task completed
#ec2-delete-disk-image -t import-i-ffm2nty0 -o $AWS_ACCESS_KEY -w $AWS_SECRET_KEY --region us-west-1

Friday, June 14, 2013

How to fix Client.ResourceLimitExceeded: Task failed to initialize - conversion task limit (5) exceeded

How to solve the issue Client.ResourceLimitExceeded: Task failed to initialize - conversion task limit (5) exceeded



Thursday, June 13, 2013

Amazon How to describe and cancel conversion tasks

1)
Export Aws Access and Secret keys

#export AWS_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXX
#export AWS_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXX

2) 
Create Import instance task
#ec2-import-instance win2k-r2-disk1.vmdk -f VMDK -t m1.small -a x86_64 -b import-export -o $AWS_ACCESS_KEY -w $AWS_SECRET_KEY --region us-west-1


3)
Describe Tasks

#ec2-describe-conversion-tasks -O $AWS_ACCESS_KEY -W $AWS_SECRET_KEY --region us-west-1

4)
Cancel Task
#ec2-cancel-conversion-task import-i-fh8kw7k3 -O $AWS_ACCESS_KEY -W $AWS_SECRET_KEY --region us-west-1

Tuesday, June 11, 2013

How to Import VMware Virtual Machine to Amazon EC2

How to Import VMware Virtual Machine to Amazon EC2

1)
Install ec2-api-tools_1.6
#wget http://launchpadlibrarian.net/111617788/ec2-api-tools_1.6.1.1-0ubuntu1_all.deb
#sudo dpkg -i ec2-api-tools_1.6.1.1-0ubuntu1_all.deb

2)
Check the Version of ec2-api-tools
#ec2-version


3)
Download Vitual Machine from ESXi node in ovf format
#ovftool vi://root:welcome@192.168.12.154/win2k-r2 win2k-r2.ovf

4)
Export Aws Access and Secret keys
#export AWS_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXX
#export AWS_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXX

5)
Create EC2 Instance using *.vmdk
#ec2-import-instance win2k-r2-disk1.vmdk -f VMDK -t m1.small -a x86_64 -b import-export -o $AWS_ACCESS_KEY -w $AWS_SECRET_KEY --region us-west-1

6)
Check the Progress of the task
#ec2-describe-conversion-tasks import-i-ffm2nty0 -O $AWS_ACCESS_KEY -W $AWS_SECRET_KEY --region us-west-1


7)
Resume task
#ec2-resume-import win2k-r2-disk1.vmdk -t import-i-ffm2nty0 -o $AWS_ACCESS_KEY -w $AWS_SECRET_KEY --region us-west-1

8)
Remove the image from S3, when the task completed
#ec2-delete-disk-image -t import-i-ffm2nty0 -o $AWS_ACCESS_KEY -w $AWS_SECRET_KEY --region us-west-1

Monday, June 10, 2013

Amazon Howto download X.509 Certificate and Private Key

Amazon Howto download X.509 Certificate and  Private Key

1)
Goto
https://console.aws.amazon.com/iam/home?#security_credential