nova compute enable password injection and filesystem resize
root@OpenstackIcehouse2:~# 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 :
root@OpenstackIcehouse2:~# ip netns exec qrouter-921c8583-b88f-40ba-8e15-0ae0c78e7296 ssh -i /root/153key.pem ubuntu@192.168.2.5
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.
ubuntu@hello:~$ 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)
ubuntu@hello:~$ 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
ubuntu@hello:~$ sudo su
sudo: unable to resolve host hello
root@hello:/home/ubuntu# cat /etc/sh
shadow shells
root@hello:/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:::
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现