nova compute enable password injection and filesystem resize

[email protected]:~# cat /etc/nova/nova-compute.conf
[DEFAULT]
compute_driver=libvirt.LibvirtDriver
[libvirt]
virt_type=qemu
libvirt_inject_partition=-1
inject_password=true

$ apt-get install libguestfs-tools
$ update-guestfs-appliance
$ libguestfs-test-tool

request:

{"server": {"name": "world", "imageRef": "6a1489cb-5905-4f97-ae8b-012770818213", "availability_zone": "nova", "key_name": "153key", "flavorRef": "2", "OS-DCF:diskConfig": "AUTO", "max_count": 1, "min_count": 1, "networks": [{"uuid": "a29561e9-2f32-4765-a0f8-306b870f780b"}], "security_groups": [{"name": "default"}]}}

http://docs.rackspace.com/servers/api/v2/cs-devguide/content/CreateServers.html

OS-DCF:diskConfig

The disk configuration value.

Valid values are:

  • AUTO: The server is built with a single partition the size of the target flavor disk. The file system is automatically adjusted to fit the entire partition. This keeps things simple and automated. AUTO is valid only for images and servers with a single partition that use the EXT3 file system. This is the default setting for applicable Rackspace base images.
  • MANUAL: The server is built using whatever partition scheme and file system is in the source image. If the target flavor disk is larger, the remaining disk space is left unpartitioned. This enables images to have non-EXT3 file systems, multiple partitions, and so on, and enables you to manage the disk configuration.

The result is :

[email protected]:~# ip netns exec qrouter-921c8583-b88f-40ba-8e15-0ae0c78e7296 ssh -i /root/153key.pem [email protected]
The authenticity of host ‘192.168.2.5 (192.168.2.5)‘ can‘t be established.
ECDSA key fingerprint is 12:2b:e6:b6:e7:10:03:be:f0:bc:96:d1:0e:d7:b2:31.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.2.5‘ (ECDSA) to the list of known hosts.
Welcome to Ubuntu 12.04.4 LTS (GNU/Linux 3.2.0-63-virtual x86_64)

* Documentation:  https://help.ubuntu.com/

  System information as of Sat May 31 22:51:08 UTC 2014

  System load:  0.28              Processes:           60
  Usage of /:   4.0% of 19.68GB   Users logged in:     0
  Memory usage: 3%                IP address for eth0: 192.168.2.5
  Swap usage:   0%

  Graph this data and manage this system at:
https://landscape.canonical.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud

0 packages can be updated.
0 updates are security updates.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

[email protected]:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr fa:16:3e:46:3c:f0 
          inet addr:192.168.2.5  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::f816:3eff:fe46:3cf0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:289 errors:0 dropped:0 overruns:0 frame:0
          TX packets:283 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:31400 (31.4 KB)  TX bytes:28240 (28.2 KB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

[email protected]:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G  801M   18G   5% /
udev            998M   12K  998M   1% /dev
tmpfs           201M  212K  201M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none           1002M     0 1002M   0% /run/shm
[email protected]:~$ sudo su
sudo: unable to resolve host hello
[email protected]:/home/ubuntu# cat /etc/sh
shadow  shells 
[email protected]:/home/ubuntu# cat /etc/shadow
root:!*:16219:0:99999:7:::
daemon:*:16219:0:99999:7:::
bin:*:16219:0:99999:7:::
sys:*:16219:0:99999:7:::
sync:*:16219:0:99999:7:::
games:*:16219:0:99999:7:::
man:*:16219:0:99999:7:::
lp:*:16219:0:99999:7:::
mail:*:16219:0:99999:7:::
news:*:16219:0:99999:7:::
uucp:*:16219:0:99999:7:::
proxy:*:16219:0:99999:7:::
www-data:*:16219:0:99999:7:::
backup:*:16219:0:99999:7:::
list:*:16219:0:99999:7:::
irc:*:16219:0:99999:7:::
gnats:*:16219:0:99999:7:::
nobody:*:16219:0:99999:7:::
libuuid:!:16219:0:99999:7:::
syslog:*:16219:0:99999:7:::
messagebus:*:16219:0:99999:7:::
whoopsie:*:16219:0:99999:7:::
landscape:*:16219:0:99999:7:::
sshd:*:16219:0:99999:7:::
ubuntu:!$6$QAW37Ccn$Rdv7jduLjDggN8FnNQzFFNSaqbbSDryKRyJfRMcHpKb/1hVJb2v9FKamvI9zG6p46ue4E9jrBBnwvDLgQs0bl/:16219:0:99999:7:::

nova compute enable password injection and filesystem resize

时间: 2024-10-21 13:07:57

nova compute enable password injection and filesystem resize的相关文章

中小企业openstack私有云布署实践【11.1 计算nova - compute节点配置(科兴环境)】

这里我只使用kxcompute1节点配置为示例,其它节点的配置基本是一样的,只是声明的管理IP不同而已 计算节点 # yum install openstack-nova-compute sysfsutils 修改配置文件 vi /etc/nova/nova.conf [DEFAULT] vcpu_pin_set = 4-31 resume_guests_state_on_host_boot=True rpc_backend = rabbit auth_strategy = keystone m

中小企业openstack私有云布署实践【11.3 计算nova - compute节点-nova用户免密登录(用于云主机冷迁移+扩展云主机大小)】

云主机迁移+扩展云主机大小 ,官方说它依赖nova用户之间的免密登录.确保每个resion区域的compute节点服务器他们可以相互SSH免密 compute1-7     他们相互SSH免密 kxcompute1-9  他们相互SSH免密 1.注意!是每台机器上的nova用户向另一台机器的nova用户的免密登录 每台compute节点修改ssh配置,目的是为了不让其提示输入yes保存密钥 vi /etc/ssh/ssh_config 尾部添加 StrictHostKeyChecking no

OpenStack 之 Nova Compute 的代码结构图

nova-compute 的代码结构图 如上图所示, 类图中最重要的三个Category Manager: 核心的业务类,提供实际的业务操作.例如启动虚拟机等等. Service: 每个service通常包括一个对应的Manager. service 也负责在消息队列上对指定的topic进行监听,当监听到新的RPC消息的时候, 调用对应的Manager的方法. Launcher: 负责管理所有的service, 包括启动service, 停止service, 维护service列表

第 5 章 Nova - 040 - Migrate Instance 操作详解

Migrate Instance 操作详解 Migrate 操作的作用是将 instance 从当前的计算节点迁移到其他节点上. Migrate 不要求源和目标节点必须共享存储,当然共享存储也是可以的. Migrate 前必须满足一个条件:计算节点间需要配置 nova 用户无密码访问. 下面是 Migrate instance 的流程图: 1.向 nova-api 发送请求 2.nova-api 发送消息 3.nova-scheduler 执行调度 4.nova-scheduler 发送消息 5

Migrate Instance 操作详解 - 每天5分钟玩转 OpenStack(40)

Migrate 操作的作用是将 instance 从当前的计算节点迁移到其他节点上. Migrate 不要求源和目标节点必须共享存储,当然共享存储也是可以的. Migrate 前必须满足一个条件:计算节点间需要配置 nova 用户无密码访问. 下面是 Migrate instance 的流程图 向 nova-api 发送请求 nova-api 发送消息 nova-scheduler 执行调度 nova-scheduler 发送消息 nova-compute 执行操作 下面我们详细讨论每一个步骤.

nova file injection

file injection代码 file injection原理来讲是比较简单的,在nova boot命令中,有参数--file,是将文件inject到image中 nova boot --flavor 2 --image d96b0e41-8264-41de-8dbb-6b31ce9bfbfc --key-name openstack --security-groups default --file /home/ubuntu/bootfromvolume1.xml=/home/cliu8/i

openstack M版安装 compute(nova)服务篇

配置安装nova compute服务 安装controller节点 一.创建nova数据库 [[email protected] ~]# mysql -u root -p >>CREATE DATABASE nova_api; >>CREATE DATABASE nova; >>GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost'   IDENTIFIED BY 'NOVA_DBPASS'; >>G

用pdb.set_trace()设断点,跟nova/api/openstack/compute/servers.py - detail() 流程

由 curl -s -H "X-Auth-Token: $OS_TOKEN" http://192.168.153.128:8774/v2.1/servers/detail | python -m json.tool 命令: 得到结果: { "servers": []       注:因为servers是核心资源,所有返回为空.} 1/opt/stack/nova/nova/api/openstack/compute/servers.py(210)detail()

nova创建虚拟机源码分析系列之八 compute创建虚机

/conductor/api.py _build_instance()  /conductor/rpcapi.py  _build_instance() 1 构造一些数据类型2 修改一些api版本信息3 投入消息队列  /conductor/manager.py  _build_instance()1 过滤信息2 调度模块工作(选出最合适的主机,并返回)3 调用/nova/compute/rpcapi.py::build_and_run_instance() 此时已经拿到最合适主机 /compu