[root@ip110 ~]# . admin.token [root@ip110 ~]<admin>#
hw_set_port 及 hw_set_passwd 兩項 extra specs。
[root@ip110 ~]<admin># openstack flavor set dyw.tiny \
hw_set_port 及 hw_set_passwd 兩項 extra specs。
--property hw_set_port=5999 --property hw_set_passwd='123qwe' [root@ip110 ~]<admin># openstack flavor show dyw.tiny +----------------------------+--------------------------------------------+ | Field | Value | +----------------------------+--------------------------------------------+ | OS-FLV-DISABLED:disabled | False | | OS-FLV-EXT-DATA:ephemeral | 0 | | access_project_ids | None | | disk | 1 | | id | 0 | | name | dyw.tiny | | os-flavor-access:is_public | True | | properties | hw_set_passwd='123qwe', hw_set_port='5999' | | ram | 64 | | rxtx_factor | 1.0 | | swap | | | vcpus | 1 | +----------------------------+--------------------------------------------+
[root@ip110 ~]<admin># . demo.token [root@ip110 ~]<demo># openstack server create --flavor dyw.tiny --image cirros5 \ --nic net-id=6ed4de53-ecc1-4c79-a9d2-8e511b26557a --security-group default \ --availability-zone nova:ip110:ip110 cirros3 --wait +-----------------------------+----------------------------------------------------------+ | Field | Value | +-----------------------------+----------------------------------------------------------+ | OS-DCF:diskConfig | MANUAL | | OS-EXT-AZ:availability_zone | nova | | OS-EXT-STS:power_state | Running | | OS-EXT-STS:task_state | None | | OS-EXT-STS:vm_state | active | | OS-SRV-USG:launched_at | 2020-06-05T11:51:51.000000 | | OS-SRV-USG:terminated_at | None | | accessIPv4 | | | accessIPv6 | | | addresses | selfservice=192.168.10.4 | | adminPass | aS4z3NpgNHhM | | config_drive | | | created | 2020-06-05T11:51:45Z | | flavor | dyw.tiny (0) | | hostId | 71c30f5bf734c2046ae66e4ceec5af8350decb8905a171de520776a9 | | id | 44267063-3f4f-4faf-813a-d4f367588934 | | image | cirros5 (c60627cd-df9c-4fdd-858c-a39fb94d9234) | | key_name | None | | name | cirros3 | | progress | 0 | | project_id | 0abfdfea73d142d08192aab5cc051642 | | properties | | | security_groups | name='default' | | status | ACTIVE | | updated | 2020-06-05T11:51:51Z | | user_id | fdae41299d574ea59fc26bef4793885b | | volumes_attached | | +-----------------------------+----------------------------------------------------------+
[root@ip110 ~]<demo># . admin.token [root@ip110 ~]<admin># nova list --all --fields=name,instance_name,status | grep cirros3 | 44267063-3f4f-4faf-813a-d4f367588934 | cirros3 | instance-00000150 | ACTIVE |
[root@ip110 ~]<admin># grep graphic /etc/libvirt/qemu/instance-00000150.xml
<graphics type='spice' port='5999' autoport='no' listen='0.0.0.0' keymap='en-us' passwd='123qwe'>
</graphics>
[root@ip110 ~]<admin># grep graphic /var/run/libvirt/qemu/instance-00000150.xml
<graphics type='spice' port='5999' autoport='no' listen='0.0.0.0' keymap='en-us' passwd='123qwe'>