通过OpenStack命令将glance-cirros镜像指定demo项目进行共享使用
时间: 2023-05-30 11:05:52 浏览: 378
1. 首先,使用以下命令登录到OpenStack:
```
$ source admin-openrc.sh
$ openstack login
```
2. 然后,使用以下命令创建一个名为“demo”的项目:
```
$ openstack project create --description "Demo Project" demo
```
3. 使用以下命令切换到“demo”项目:
```
$ source demo-openrc.sh
```
4. 接下来,使用以下命令将“glance-cirros”镜像添加到“demo”项目中:
```
$ openstack image set --property project_id=demo <glance-cirros-image-id>
```
其中,<glance-cirros-image-id>是“glance-cirros”镜像的ID。
5. 最后,使用以下命令将“glance-cirros”镜像设置为公共可见:
```
$ openstack image set --public <glance-cirros-image-id>
```
这样,“demo”项目中的用户就可以访问和使用“glance-cirros”镜像了。
相关问题
使用OpenStack私有云平台,在OpenStack平台的admin项目中使用cirros-0.3.4-x86_64-disk.img镜像文件创建名为glance-cirros的镜像,通过OpenStack命令将glance-cirros镜像指定demo项目进行共享使用
可以使用以下命令创建名为glance-cirros的镜像并将其共享给demo项目:
1. 首先,使用以下命令在admin项目中上传cirros-0.3.4-x86_64-disk.img镜像文件:
```
openstack image create --disk-format qcow2 --container-format bare --file cirros-0.3.4-x86_64-disk.img glance-cirros
```
2. 然后,使用以下命令将glance-cirros镜像共享给demo项目:
```
openstack image set --property visibility=shared glance-cirros
openstack image add project demo glance-cirros
```
这样,demo项目就可以使用glance-cirros镜像了。
在OpenStack平台的admin项目中使用cirros-0.3.4-x86_64-disk.img镜像文件创建名为glance-cirros的镜像,通过OpenStack命令将glance-cirros镜像指定demo项目进行共享使用
1. 将cirros-0.3.4-x86_64-disk.img镜像文件上传到OpenStack平台中的glance镜像服务中。
```
$ openstack image create --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public glance-cirros
```
2. 将glance-cirros镜像共享给demo项目。
```
$ openstack image set --property visibility=shared glance-cirros
$ openstack image add project demo glance-cirros
```
现在,demo项目就可以使用glance-cirros镜像了。
相关推荐
![rtf](https://img-home.csdnimg.cn/images/20210720083624.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)