[Devel] [Q] Connecting a physical HDD/partition to a container

Igor Sukhih igor at virtuozzo.com
Wed Jan 27 07:23:51 PST 2016


On 01/27/2016 06:02 PM, Evgenii Shatokhin wrote:
> 27.01.2016 16:38, Igor Sukhih пишет:
>> On 01/27/2016 04:29 PM, Stanislav Kinsburskiу wrote:
>>> 27 янв. 2016 г. 14:24 пользователь Evgenii Shatokhin
>>> <eshatokhin at virtuozzo.com> написал:
>>>> I created it with
>>>> vzctl set 101 --devnodes sdb1:rw --save
>>>>
>>>> The node is now present in the CT. However, if I try to mount it in
>>>> the CT (mount /dev/sdb1 /mnt), no error is reported but mount seems to
>>>> have no effect. No files are seen in /mnt that are present on that
>>>> partition.
>>>>
>>>> So, I guess, additional steps are needed?
>>>>
>>>>> You might need sysfs layout.
>>>>> Please, strace your mount call and send it as a reply (attached).
>>>>>
>>>> Here it is.
>>>>
>>>> As far as I can see in strace log, mount tries to open
>>>> /sys/dev/block/8:17, indeed. This file is present on the host but 
>>>> not in
>>>> the CT.
>>>>
>>> Expectable.
>>> Then you have to expose sysfs for this device to the container.
>>> Igor, could you advice, please?
>>>
>>
>> Lets try to use secondary disk feature first
>>
>> vzctl set VEID --device-add hdd --device /dev/sda --save
>
> No luck. The CT fails to start with "Failed to configure disk" after 
> that.
>
> Details:
> -------------------
> [root at vz-test2]# vzctl set 101 --device-add hdd --device /dev/sdb --save
> The device /dev/sdb uuid={d6f09c24-99f3-4ead-8504-4a8ff810490b} has 
> been successfully added.
>
> [root at vz-test2]# # vzctl start 101
> Starting Container ...
> Mount image: /vz/private/6bd8d99b-e20c-4204-931a-f12dea70ea95/root.hdd
> Opening delta 
> /vz/private/6bd8d99b-e20c-4204-931a-f12dea70ea95/root.hdd/root.hds
> Adding delta dev=/dev/ploop41020 
> img=/vz/private/6bd8d99b-e20c-4204-931a-f12dea70ea95/root.hdd/root.hds 
> (rw)
> Mounting /dev/ploop41020p1 at 
> /vz/root/6bd8d99b-e20c-4204-931a-f12dea70ea95 fstype=ext4 
> data='balloon_ino=12,pfcache_csum,,'
> Container is mounted
> Os release: 3.10.0-327.3.1.vz7.10.4
> Create /etc/tmpfiles.d/device-ploop41020p1.conf
> Setting permissions for 
> image=/vz/private/6bd8d99b-e20c-4204-931a-f12dea70ea95/root.hdd
> Setting permissions 104 dev 0xa030b6c1
> Setting mount options for image=/dev/sdb opts=8:17;1 
> balloon_ino=12,pfcache_csum,,
> Setting permissions for image=/dev/sdb
> Setting permissions 104 dev 0x811
> Create /etc/tmpfiles.d/device-ploop1p1.conf
> Can't open /sys/class/block/ploop1p1/uevent for writing: No such file 
> or directory
> Failed to configure disk
> Cancel init execution 172
> Unmount image: /vz/private/6bd8d99b-e20c-4204-931a-f12dea70ea95/root.hdd
> Unmounting file system at /vz/root/6bd8d99b-e20c-4204-931a-f12dea70ea95
> Unmounting device /dev/ploop41020
> Container is unmounted
> Failed to start the Container
> -------------------
>
> Regards,
> Eugene

Pls recheck on  libvzctl >= 7.0.172

--
   Igor



More information about the Devel mailing list