1、上传镜像是成功的
glance add name="ubuntu" is_public=true container_format=ovf disk_format=qcow2 < ubuntu.img
2、创建密钥也是成功的
ssh-keygen
cd .ssh
nova keypair-add --pub_key id_rsa.pub mykey
3、创建实例
nova boot --flavor 1 --image 9bab7ce7-7523-4d37-831f-c18fbc5cb543 --key_name mykey myinstance
创建好后如下
+-------------------------------------+--------------------------------------+
| Property                            | Value                                |
+-------------------------------------+--------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                               |
| OS-EXT-SRV-ATTR:host                | None                                 |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None                                 |
| OS-EXT-SRV-ATTR:instance_name       | instance-00000002                    |
| OS-EXT-STS:power_state              | 0                                    |
| OS-EXT-STS:task_state               | scheduling                           |
| OS-EXT-STS:vm_state                 | building                             |
| accessIPv4                          |                                      |
| accessIPv6                          |                                      |
| adminPass                           | HDLeEMAE8zpY                         |
| config_drive                        |                                      |
| created                             | 2011-08-31T17:06:21Z                 |
| flavor                              | m1.tiny                              |
| hostId                              |                                      |
| id                                  | 8496a9e4-0a00-4259-8130-2115de113fd9 |
| image                               | ubuntu                               |
| key_name                            | mykey                                |
| metadata                            | {}                                   |
| name                                | myinstance                           |
| progress                            | 0                                    |
| security_groups                     | [{u'name': u'default'}]              |
| status                              | BUILD                                |
| tenant_id                           | d7ce899d431e44dab785dcae898c9fa5     |
| updated                             | 2011-08-31T17:06:21Z                 |
| user_id                             | c3e7264ab810463ea5f2fe5e49b2485e     |
+-------------------------------------+--------------------------------------+
3、
$ nova list
+--------------------------------------+------------+--------+----------+
| ID                                   | Name       | Status | Networks |
+--------------------------------------+------------+--------+----------+
| 352c84ef-efe0-4d72-81e5-7530f4a29d86 | myinstance | ERROR  |          |
| 8496a9e4-0a00-4259-8130-2115de113fd9 | myinstance | ERROR  |          |
+--------------------------------------+------------+--------+----------+
为什么状态是ERROR,而且没有IP地址

解决方案 »

  1.   

    1.首先看network服务启动没有
    2.其次,是否执行了nova-manage network create 创建IP地址池
    3.最后,你的机器是否支持虚拟
    Trying to launch a new virtual machine instance fails with the ERROR state, and the
    following error appears in /var/log/nova/nova-compute.log
    libvirtError: internal error no supported architecture for os type 'hvm'
    OpenStack Compute
    This is a symptom that the KVM kernel modules have not been loaded.Intel-based processors
    If your compute host is Intel-based, run the following as root to load the kernel modules:
    # modprobe kvm
    # modprobe kvm-intel
    Add the following lines to /etc/modules so that these modules will load on reboot:
    kvm
    kvm-intel
    AMD-based processors
    If your compute host is AMD-based, run the following as root to load the kernel modules:
    # modprobe kvm
    # modprobe kvm-amd
    Add the following lines to /etc/modules so that these modules will load on reboot:
    kvm
    kvm-amd