Skip to content

通过知识获得解放,通过技术获得自由

Menu
  • 专题目录
  • 液压相关
    • 液压技术
    • 液压相邻技术
    • 液压应用
  • 计算机相关
    • 计算机和软件
    • 网络和网站技术
  • 哲学
  • 关于本站
Menu

PVE扩充外部存储—iscsi[0]

Posted on 2023年11月14日 by

之前通过iscsi给PVE中的win10虚拟机增加过硬盘(详见win10挂载iscsi磁盘),最近想着也可以直接给虚拟机增加块存储。

本处记录操作的过程

  • synology上的设置

synology创建lun默认管理已有的iscsi目标服务器,因此对于有多个iscsi目标服务器的情况,应该先创建iscsi target标识。

  • pve上的设置

pve上设置主要分为挂载iscsi和格式化硬盘

1)挂载iscsi目标

ID: ==>就是这个磁盘的id,随意填写,不过需要字母
portal: ==> iscsi服务器的地址
target: ==>在输入以上2个信息后,iscsi会自动搜索服务器存在的target,这里选择自己需要的target
节点:选择使用刚才查找iqn的节点
直接使用LUN 不要勾选!lun就是直接作为虚拟机磁盘使用

iscsi目标已经挂载成功,但是不能够直接使用,相当于裸盘。

2)创建iscsi磁盘分区与格式化硬盘

lsblk

然后创建lvm

pvcreate /dev/sdb1                  创建pv
vgcreate iscsi1 /dev/sdb1            创建一个名为iscsi1的vg

3)pve面板添加

测试使用iscsi硬盘的centos8虚拟机安装和启动正常。

  • 结论

此种方式只能用作磁盘镜像和容器。

此种方式相当于synology将其管理的一部分硬盘空间作为块储存通过网线给pve主机使用,进而再给各个虚拟机使用。

这种方式能够将cpu资源和存储资源进行分离,进而实现不基于特定cpu和存储的泛计算方式。

但是对于硬件的要求变成,本地的synology和pve主机的稳定性和网络的可靠性。

 

补充说明:

1)格式化iscsi硬盘时显示无法格式

The device contains ‘dos’ signature and it will be removed by a write command.

处理如下:

lsblk #列出块存储
wipefs /dev/sdb #显示当前签名
wipefs --all --force /dev/sdb #清除签名

2)在pve重启后发现iscsi重新连接异常,不推荐此方式挂载块存储。

参考资料:

  1. https://www.cyberciti.biz/faq/howto-use-wipefs-to-wipe-a-signature-from-disk-on-linux/
  2. https://wp.gxnas.com/9345.html
  3. https://foxi.buduanwang.vip/linux/270.html/

欢迎回来

希望本站对你有所帮助!

如有疑问请联系info@fanlog.org
2023 年 11 月
一二三四五六日
 12345
6789101112
13141516171819
20212223242526
27282930 
« 6 月    

AI辅助 (17)

© 2025 | Powered by Superbs Personal Blog theme
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT