特殊:Badtitle/NS100:UEC/RunningImages:修订间差异
小 创建新页面为 '{{From|https://help.ubuntu.com/community/UEC/RunningImages}} {{Languages|UbuntuHelp:UEC/RunningImages}} There are multiple ways to instantiate an image in UEC: * Use the command...' |
小无编辑摘要 |
||
第10行: | 第10行: | ||
<pre><nowiki> | <pre><nowiki> | ||
if [ ! -e ~/.euca/mykey.priv ]; then | if [ ! -e ~/.euca/mykey.priv ]; then | ||
mkdir -p -m 700 ~/.euca | |||
touch ~/.euca/mykey.priv | touch ~/.euca/mykey.priv | ||
chmod 0600 ~/.euca/mykey.priv | chmod 0600 ~/.euca/mykey.priv | ||
第21行: | 第22行: | ||
<pre><nowiki> | <pre><nowiki> | ||
euca-authorize default -P tcp -p 22 -s 0.0.0.0/0 | euca-authorize default -P tcp -p 22 -s 0.0.0.0/0 | ||
</nowiki></pre> | </nowiki></pre> | ||
第27行: | 第27行: | ||
<pre><nowiki> | <pre><nowiki> | ||
euca-run-instances $EMI -k mykey -t | euca-run-instances $EMI -k mykey -t m1.small | ||
</nowiki></pre> | </nowiki></pre> | ||
{|border="1" cellspacing="0" | {|border="1" cellspacing="0" |
2010年5月20日 (四) 00:39的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/UEC/RunningImages }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/af | • {{#if: UbuntuHelp:UEC/RunningImages|Afrikaans| [[::UEC/RunningImages/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/ar | • {{#if: UbuntuHelp:UEC/RunningImages|العربية| [[::UEC/RunningImages/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/az | • {{#if: UbuntuHelp:UEC/RunningImages|azərbaycanca| [[::UEC/RunningImages/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/bcc | • {{#if: UbuntuHelp:UEC/RunningImages|جهلسری بلوچی| [[::UEC/RunningImages/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/bg | • {{#if: UbuntuHelp:UEC/RunningImages|български| [[::UEC/RunningImages/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/br | • {{#if: UbuntuHelp:UEC/RunningImages|brezhoneg| [[::UEC/RunningImages/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/ca | • {{#if: UbuntuHelp:UEC/RunningImages|català| [[::UEC/RunningImages/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/cs | • {{#if: UbuntuHelp:UEC/RunningImages|čeština| [[::UEC/RunningImages/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/de | • {{#if: UbuntuHelp:UEC/RunningImages|Deutsch| [[::UEC/RunningImages/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/el | • {{#if: UbuntuHelp:UEC/RunningImages|Ελληνικά| [[::UEC/RunningImages/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/es | • {{#if: UbuntuHelp:UEC/RunningImages|español| [[::UEC/RunningImages/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/fa | • {{#if: UbuntuHelp:UEC/RunningImages|فارسی| [[::UEC/RunningImages/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/fi | • {{#if: UbuntuHelp:UEC/RunningImages|suomi| [[::UEC/RunningImages/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/fr | • {{#if: UbuntuHelp:UEC/RunningImages|français| [[::UEC/RunningImages/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/gu | • {{#if: UbuntuHelp:UEC/RunningImages|ગુજરાતી| [[::UEC/RunningImages/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/he | • {{#if: UbuntuHelp:UEC/RunningImages|עברית| [[::UEC/RunningImages/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/hu | • {{#if: UbuntuHelp:UEC/RunningImages|magyar| [[::UEC/RunningImages/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/id | • {{#if: UbuntuHelp:UEC/RunningImages|Bahasa Indonesia| [[::UEC/RunningImages/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/it | • {{#if: UbuntuHelp:UEC/RunningImages|italiano| [[::UEC/RunningImages/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/ja | • {{#if: UbuntuHelp:UEC/RunningImages|日本語| [[::UEC/RunningImages/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/ko | • {{#if: UbuntuHelp:UEC/RunningImages|한국어| [[::UEC/RunningImages/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/ksh | • {{#if: UbuntuHelp:UEC/RunningImages|Ripoarisch| [[::UEC/RunningImages/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/mr | • {{#if: UbuntuHelp:UEC/RunningImages|मराठी| [[::UEC/RunningImages/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/ms | • {{#if: UbuntuHelp:UEC/RunningImages|Bahasa Melayu| [[::UEC/RunningImages/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/nl | • {{#if: UbuntuHelp:UEC/RunningImages|Nederlands| [[::UEC/RunningImages/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/no | • {{#if: UbuntuHelp:UEC/RunningImages|norsk| [[::UEC/RunningImages/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/oc | • {{#if: UbuntuHelp:UEC/RunningImages|occitan| [[::UEC/RunningImages/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/pl | • {{#if: UbuntuHelp:UEC/RunningImages|polski| [[::UEC/RunningImages/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/pt | • {{#if: UbuntuHelp:UEC/RunningImages|português| [[::UEC/RunningImages/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/ro | • {{#if: UbuntuHelp:UEC/RunningImages|română| [[::UEC/RunningImages/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/ru | • {{#if: UbuntuHelp:UEC/RunningImages|русский| [[::UEC/RunningImages/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/si | • {{#if: UbuntuHelp:UEC/RunningImages|සිංහල| [[::UEC/RunningImages/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/sq | • {{#if: UbuntuHelp:UEC/RunningImages|shqip| [[::UEC/RunningImages/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/sr | • {{#if: UbuntuHelp:UEC/RunningImages|српски / srpski| [[::UEC/RunningImages/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/sv | • {{#if: UbuntuHelp:UEC/RunningImages|svenska| [[::UEC/RunningImages/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/th | • {{#if: UbuntuHelp:UEC/RunningImages|ไทย| [[::UEC/RunningImages/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/tr | • {{#if: UbuntuHelp:UEC/RunningImages|Türkçe| [[::UEC/RunningImages/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/vi | • {{#if: UbuntuHelp:UEC/RunningImages|Tiếng Việt| [[::UEC/RunningImages/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/yue | • {{#if: UbuntuHelp:UEC/RunningImages|粵語| [[::UEC/RunningImages/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/zh | • {{#if: UbuntuHelp:UEC/RunningImages|中文| [[::UEC/RunningImages/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/zh-hans | • {{#if: UbuntuHelp:UEC/RunningImages|中文(简体)| [[::UEC/RunningImages/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:UEC/RunningImages | UbuntuHelp:UEC/RunningImages | {{#if: | :}}UEC/RunningImages}}/zh-hant | • {{#if: UbuntuHelp:UEC/RunningImages|中文(繁體)| [[::UEC/RunningImages/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:UEC/RunningImages|:UEC/RunningImages|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :UEC/RunningImages/zh | | {{#ifexist: UEC/RunningImages/zh | | {{#ifeq: {{#titleparts:UEC/RunningImages|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:UEC/RunningImages|1|-1|}} | zh | | }}
There are multiple ways to instantiate an image in UEC:
- Use the command line
- Use one of the UEC compatible management tools such as Landscape
- Use the ElasticFox extension to Firefox
Here we will describe the process from the command line:
- Before running an instance of your image, you should first create a keypair (ssh key) that you can use to log into your instance as root, once it boots. The key is stored, so you will only have to do this once. Run the following command:
if [ ! -e ~/.euca/mykey.priv ]; then mkdir -p -m 700 ~/.euca touch ~/.euca/mykey.priv chmod 0600 ~/.euca/mykey.priv euca-add-keypair mykey > ~/.euca/mykey.priv fi
Note: You can call your key whatever you like (in this example, the key is called 'mykey'), but remember what it is called. If you forget, you can always run euca-describe-keypairs to get a list of created keys stored in the system.
|
- You must also allow access to port 22 in your instances:
euca-authorize default -P tcp -p 22 -s 0.0.0.0/0
- Next, you can create instances of your registered image:
euca-run-instances $EMI -k mykey -t m1.small
Note: If you receive an error regarding image_id, you may find it by viewing Images page or click "How to Run" on the Store page to see the sample command. |
- The first time you run an instance, the system will be setting up caches for the image from which it will be created. This can often take some time the first time an instance is run given that VM images are usually quite large. To monitor the state of your instance, run:
watch -n5 euca-describe-instances
In the output, you should see information about the instance, including its state. While first-time caching is being performed, the instance's state will be 'pending'.
- When the instance is fully started, the above state will become 'running'. Look at the IP address assigned to your instance in the output, then connect to it:
IPADDR=$(euca-describe-instances | grep $EMI | grep running | tail -n1 | awk '{print $4}') ssh -i ~/.euca/mykey.priv ubuntu@$IPADDR
- And when you are done with this instance, exit your SSH connection, then terminate your instance:
INSTANCEID=$(euca-describe-instances | grep $EMI | grep running | tail -n1 | awk '{print $2}') euca-terminate-instances $INSTANCEID