问题导读
1、如何创建自定义 flavor?
2、怎样将tenant ID分配到对应的 project?
3、如何理解密钥的作用?
帮助
- [root@station140 tmp(keystone_admin)]# nova help | grep flavor
- flavor-access-add Add flavor access for the given tenant.
- flavor-access-list Print access information about the given flavor.
- flavor-access-remove
- Remove flavor access for the given tenant.
- flavor-create Create a new flavor
- flavor-delete Delete a specific flavor
- flavor-key Set or unset extra_spec for a flavor.
- flavor-list Print a list of available 'flavors' (sizes of
- flavor-show Show details about the given flavor.
- volume-type-delete Delete a specific flavor
复制代码
创建自定义 flavor
- [root@station140 tmp(keystone_admin)]# nova flavor-create m1.vcomputer 6 2048 20 1
- +----+--------------+-----------+------+-----------+------+-------+-------------+-----------+
- | ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
- +----+--------------+-----------+------+-----------+------+-------+-------------+-----------+
- | 6 | m1.vcomputer | 2048 | 20 | 0 | | 1 | 1.0 | True |
- +----+--------------+-----------+------+-----------+------+-------+-------------+-----------+
复制代码
列出
- [root@station140 tmp(keystone_admin)]# nova flavor-list
- +----+--------------+-----------+------+-----------+------+-------+-------------+-----------+
- | ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
- +----+--------------+-----------+------+-----------+------+-------+-------------+-----------+
- | 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
- | 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
- | 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
- | 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
- | 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
- | 6 | m1.vcomputer | 2048 | 10 | 0 | | 1 | 1.0 | True |
- +----+--------------+-----------+------+-----------+------+-------+-------------+-----------+
复制代码
查询一下 tenant ID
- [root@station140 ~(keystone_admin)]# keystone tenant-list
- +----------------------------------+----------+---------+
- | id | name | enabled |
- +----------------------------------+----------+---------+
- | 9467f30b8bba4770a06a687e4584636b | cloud | True |
- +----------------------------------+----------+---------+
复制代码
创建后需要分配到对应的 project
- [root@station140 tmp(keystone_admin)]# nova flavor-access-add 6 9467f30b8bba4770a06a687e4584636b
- +-----------+----------------------------------+
- | Flavor_ID | Tenant_ID |
- +-----------+----------------------------------+
- | 6 | 9467f30b8bba4770a06a687e4584636b |
- +-----------+----------------------------------+
复制代码
注意下面错误信息
- [root@station140 tmp(keystone_admin)]# nova flavor-access-list --flavor 6 <- 不针对 public 哟
- ERROR: Failed to get access list for public flavor type.
复制代码
openstack 命令行管理:密钥管理
帮助
- [root@station140 ~(keystone_admin)]# nova help | grep key
- flavor-key Set or unset extra_spec for a flavor.
- keypair-add Create a new key pair for use with instances.
- keypair-delete Delete keypair given by its name.
- keypair-list Print a list of keypairs for a user
- keypair-show Show details about the given keypair.
复制代码
创建密钥方法 [ 略 ]
ssh-keygen 命令 (默认安装时候已经生成密钥)
添加密钥方法
- [root@station140 ~(keystone_admin)]# nova keypair-add --pub-key /root/.ssh/id_rsa.pub terrykey
复制代码
显示密钥方法
- [root@station140 ~(keystone_admin)]# nova keypair-list
- +----------+-------------------------------------------------+
- | Name | Fingerprint |
- +----------+-------------------------------------------------+
- | terrykey | 94:b8:9c:2a:31:8c:2c:87:7f:f5:80:24:23:73:f8:e9 |
- +----------+-------------------------------------------------+
复制代码
密钥作用
当 instance 分配了浮动 IP 后, 允许 server 能够直接访问 instance 时候, 才可以利用密钥配对进行访问
假如通过 novnc 进行访问时候, 仍然需要通过 root/password 方法进行访问
上一篇:
openstack 命令行管理四:角色管理;服务管理 命令总结
下一篇:
openstack 命令行管理六:安全组管理;内部网络管理 命令总结
|