You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Gaurav Aradhye <ga...@clogeny.com> on 2013/08/26 10:38:19 UTC

Writing to volume attached to VM

Hi all,

Can you guide me on how to write on the external volume (DataDisk) attached
to a VM?

I am trying to mount the partition, but the list of partitions before and
after attaching the volume to vm, remains the same, so I am unable to
detect which partition has been added.

Has anybody done this before through test case?

Regards,
Gaurav

RE: Writing to volume attached to VM

Posted by Suresh Sadhu <Su...@citrix.com>.
Cool Gaurav and you can do without reboot also and it's up to you choose which one is feasible to you .

General way:
echo "- - -" > /sys/class/scsi_host/<host listings here>/scan    [ search for " linux scan lun with out reboot"]
eg:
echo "- - -" > /sys/class/scsi_host/host1/scan       

or reboot the vm will detect the newly added the luns during boot-up.


Regards
sadhu

-----Original Message-----
From: Gaurav Aradhye [mailto:gaurav.aradhye@clogeny.com] 
Sent: 27 August 2013 11:54
To: dev@cloudstack.apache.org
Subject: Re: Writing to volume attached to VM

Hi Suresh/Sanjeev,

Thanks for the inputs.

I tried making partition manually and it works, the new partition is then listed. However it is little complex through doing that through test case.

Simple reboot does the same thing, it is listing out the new partitions after the reboot. Apparently the problem is solved.

Thanks!

Regards,
Gaurav


On Mon, Aug 26, 2013 at 5:17 PM, Sanjeev Neelarapu < sanjeev.neelarapu@citrix.com> wrote:

> In case of vmware vm needs to have pv-drivers installed to hot-plugin 
> the disk. Otherwise vm restart will show the attached disks .
>
> -----Original Message-----
> From: Suresh Sadhu [mailto:Suresh.Sadhu@citrix.com]
> Sent: Monday, August 26, 2013 3:09 PM
> To: dev@cloudstack.apache.org
> Subject: RE: Writing to volume attached to VM
>
>
> /dev/vdb is your data disk
>
> CS won't format automatically ,you have to manually create LV and 
> format operations
>
>  do the following steps:
>
> Fdisk /dev/vdb
>
> Option m will provide the menu in that menu select  option to create 
> new pattiton
>
> 2.  Select n option  to create new partition  and choose/accept  the 
> default value during partition creation
>
> 3. Once partition got created ,select the w option to write I node 
> table info 4.now you can see /vbb ,vdb1  when you enter fdisk -l
> 5 format the the  logical partition  created in step 4  like mkfs.ext3 
> /dev/vdb 6. mount the disk mount /dev/vdb1 /mnt  and perform IO on 
> mounted
> path(/mnt)
>
> Hope this helps:
>
>
> Regards
> Sadhu
>
>
> -----Original Message-----
> From: Gaurav Aradhye [mailto:gaurav.aradhye@clogeny.com]
> Sent: 26 August 2013 14:53
> To: dev@cloudstack.apache.org
> Subject: Re: Writing to volume attached to VM
>
> Hi,
>
> Answering your questions in order c,a,b.
>
> c) I am listing the partitions on the vm using fdisk -l command.
> This is giving me following output.
>
>  ['', 'Disk /dev/vda: 8589 MB, 8589934592 bytes', '255 head
>
> s, 63 sectors/track, 1044 cylinders', 'Units = cylinders of 16065 * 
> 512 =
> 8225280 bytes', '', ' Device Boot Start End Blocks Id System',
>
> '/dev/vda1 * 1 13 104391 83 Linux', '/dev/vda2 14 1044 8281507+ 8e 
> Linux LVM', '', 'Disk /dev/vdb: 1073 M
>
> B, 1073741824 bytes', '16 heads, 63 sectors/track, 2080 cylinders', 
> 'Units = cylinders of 1008 * 512 = 516096 bytes', '']
>
>
> As you can see two disks /dev/vda and /dev/vdb are listed.
>
> This output remains the same after attaching a volume to the vm.
>
>
> a) As I am not able to identify any new partition, not able to detect 
> the exact partition that needs to be mounted.
>
> This is where I need help. How to identify the volume partitions and 
> mount them?
>
>
> b) Once the device is identified, it can be mounted using mount command.
> Right now it is mounting the root disk partitions.
>
>
> Firing all these commands to using remoteSSHClient of vm.
>
>
>
> Regards,
> Gaurav
>
>
> On Mon, Aug 26, 2013 at 2:16 PM, Prasanna Santhanam <ts...@apache.org>
> wrote:
>
> > On Mon, Aug 26, 2013 at 02:08:19PM +0530, Gaurav Aradhye wrote:
> > > Hi all,
> > >
> > > Can you guide me on how to write on the external volume (DataDisk)
> > attached
> > > to a VM?
> > >
> > > I am trying to mount the partition, but the list of partitions 
> > > before and after attaching the volume to vm, remains the same, so 
> > > I am unable to detect which partition has been added.
> >
> > How do you
> > a) identify the device on which the disk is available to be mounted
> > b) mount the formatted device to your VM
> > c) list the partitions/disks
> >
> > Some commands on how you do this will help.
> >
> > >
> > > Has anybody done this before through test case?
> > >
> > > Regards,
> > > Gaurav
> >
> > --
> > Prasanna.,
> >
> > ------------------------
> > Powered by BigRock.com
> >
> >
>

Re: Writing to volume attached to VM

Posted by Gaurav Aradhye <ga...@clogeny.com>.
Hi Suresh/Sanjeev,

Thanks for the inputs.

I tried making partition manually and it works, the new partition is then
listed. However it is little complex through doing that through test case.

Simple reboot does the same thing, it is listing out the new partitions
after the reboot. Apparently the problem is solved.

Thanks!

Regards,
Gaurav


On Mon, Aug 26, 2013 at 5:17 PM, Sanjeev Neelarapu <
sanjeev.neelarapu@citrix.com> wrote:

> In case of vmware vm needs to have pv-drivers installed to hot-plugin the
> disk. Otherwise vm restart will show the attached disks .
>
> -----Original Message-----
> From: Suresh Sadhu [mailto:Suresh.Sadhu@citrix.com]
> Sent: Monday, August 26, 2013 3:09 PM
> To: dev@cloudstack.apache.org
> Subject: RE: Writing to volume attached to VM
>
>
> /dev/vdb is your data disk
>
> CS won't format automatically ,you have to manually create LV and format
> operations
>
>  do the following steps:
>
> Fdisk /dev/vdb
>
> Option m will provide the menu in that menu select  option to create new
> pattiton
>
> 2.  Select n option  to create new partition  and choose/accept  the
> default value during partition creation
>
> 3. Once partition got created ,select the w option to write I node table
> info 4.now you can see /vbb ,vdb1  when you enter fdisk -l
> 5 format the the  logical partition  created in step 4  like mkfs.ext3
> /dev/vdb 6. mount the disk mount /dev/vdb1 /mnt  and perform IO on mounted
> path(/mnt)
>
> Hope this helps:
>
>
> Regards
> Sadhu
>
>
> -----Original Message-----
> From: Gaurav Aradhye [mailto:gaurav.aradhye@clogeny.com]
> Sent: 26 August 2013 14:53
> To: dev@cloudstack.apache.org
> Subject: Re: Writing to volume attached to VM
>
> Hi,
>
> Answering your questions in order c,a,b.
>
> c) I am listing the partitions on the vm using fdisk -l command.
> This is giving me following output.
>
>  ['', 'Disk /dev/vda: 8589 MB, 8589934592 bytes', '255 head
>
> s, 63 sectors/track, 1044 cylinders', 'Units = cylinders of 16065 * 512 =
> 8225280 bytes', '', ' Device Boot Start End Blocks Id System',
>
> '/dev/vda1 * 1 13 104391 83 Linux', '/dev/vda2 14 1044 8281507+ 8e Linux
> LVM', '', 'Disk /dev/vdb: 1073 M
>
> B, 1073741824 bytes', '16 heads, 63 sectors/track, 2080 cylinders', 'Units
> = cylinders of 1008 * 512 = 516096 bytes', '']
>
>
> As you can see two disks /dev/vda and /dev/vdb are listed.
>
> This output remains the same after attaching a volume to the vm.
>
>
> a) As I am not able to identify any new partition, not able to detect the
> exact partition that needs to be mounted.
>
> This is where I need help. How to identify the volume partitions and mount
> them?
>
>
> b) Once the device is identified, it can be mounted using mount command.
> Right now it is mounting the root disk partitions.
>
>
> Firing all these commands to using remoteSSHClient of vm.
>
>
>
> Regards,
> Gaurav
>
>
> On Mon, Aug 26, 2013 at 2:16 PM, Prasanna Santhanam <ts...@apache.org>
> wrote:
>
> > On Mon, Aug 26, 2013 at 02:08:19PM +0530, Gaurav Aradhye wrote:
> > > Hi all,
> > >
> > > Can you guide me on how to write on the external volume (DataDisk)
> > attached
> > > to a VM?
> > >
> > > I am trying to mount the partition, but the list of partitions
> > > before and after attaching the volume to vm, remains the same, so I
> > > am unable to detect which partition has been added.
> >
> > How do you
> > a) identify the device on which the disk is available to be mounted
> > b) mount the formatted device to your VM
> > c) list the partitions/disks
> >
> > Some commands on how you do this will help.
> >
> > >
> > > Has anybody done this before through test case?
> > >
> > > Regards,
> > > Gaurav
> >
> > --
> > Prasanna.,
> >
> > ------------------------
> > Powered by BigRock.com
> >
> >
>

RE: Writing to volume attached to VM

Posted by Sanjeev Neelarapu <sa...@citrix.com>.
In case of vmware vm needs to have pv-drivers installed to hot-plugin the disk. Otherwise vm restart will show the attached disks .

-----Original Message-----
From: Suresh Sadhu [mailto:Suresh.Sadhu@citrix.com] 
Sent: Monday, August 26, 2013 3:09 PM
To: dev@cloudstack.apache.org
Subject: RE: Writing to volume attached to VM


/dev/vdb is your data disk

CS won't format automatically ,you have to manually create LV and format operations

 do the following steps:

Fdisk /dev/vdb

Option m will provide the menu in that menu select  option to create new pattiton
 
2.  Select n option  to create new partition  and choose/accept  the default value during partition creation

3. Once partition got created ,select the w option to write I node table info 4.now you can see /vbb ,vdb1  when you enter fdisk -l
5 format the the  logical partition  created in step 4  like mkfs.ext3 /dev/vdb 6. mount the disk mount /dev/vdb1 /mnt  and perform IO on mounted path(/mnt)

Hope this helps:


Regards
Sadhu


-----Original Message-----
From: Gaurav Aradhye [mailto:gaurav.aradhye@clogeny.com]
Sent: 26 August 2013 14:53
To: dev@cloudstack.apache.org
Subject: Re: Writing to volume attached to VM

Hi,

Answering your questions in order c,a,b.

c) I am listing the partitions on the vm using fdisk -l command.
This is giving me following output.

 ['', 'Disk /dev/vda: 8589 MB, 8589934592 bytes', '255 head

s, 63 sectors/track, 1044 cylinders', 'Units = cylinders of 16065 * 512 =
8225280 bytes', '', ' Device Boot Start End Blocks Id System',

'/dev/vda1 * 1 13 104391 83 Linux', '/dev/vda2 14 1044 8281507+ 8e Linux LVM', '', 'Disk /dev/vdb: 1073 M

B, 1073741824 bytes', '16 heads, 63 sectors/track, 2080 cylinders', 'Units = cylinders of 1008 * 512 = 516096 bytes', '']


As you can see two disks /dev/vda and /dev/vdb are listed.

This output remains the same after attaching a volume to the vm.


a) As I am not able to identify any new partition, not able to detect the exact partition that needs to be mounted.

This is where I need help. How to identify the volume partitions and mount them?


b) Once the device is identified, it can be mounted using mount command.
Right now it is mounting the root disk partitions.


Firing all these commands to using remoteSSHClient of vm.



Regards,
Gaurav


On Mon, Aug 26, 2013 at 2:16 PM, Prasanna Santhanam <ts...@apache.org> wrote:

> On Mon, Aug 26, 2013 at 02:08:19PM +0530, Gaurav Aradhye wrote:
> > Hi all,
> >
> > Can you guide me on how to write on the external volume (DataDisk)
> attached
> > to a VM?
> >
> > I am trying to mount the partition, but the list of partitions 
> > before and after attaching the volume to vm, remains the same, so I 
> > am unable to detect which partition has been added.
>
> How do you
> a) identify the device on which the disk is available to be mounted
> b) mount the formatted device to your VM
> c) list the partitions/disks
>
> Some commands on how you do this will help.
>
> >
> > Has anybody done this before through test case?
> >
> > Regards,
> > Gaurav
>
> --
> Prasanna.,
>
> ------------------------
> Powered by BigRock.com
>
>

RE: Writing to volume attached to VM

Posted by Suresh Sadhu <Su...@citrix.com>.
/dev/vdb is your data disk

CS won't format automatically ,you have to manually create LV and format operations

 do the following steps:

Fdisk /dev/vdb

Option m will provide the menu in that menu select  option to create new pattiton
 
2.  Select n option  to create new partition  and choose/accept  the default value during partition creation

3. Once partition got created ,select the w option to write I node table info
4.now you can see /vbb ,vdb1  when you enter fdisk -l
5 format the the  logical partition  created in step 4  like mkfs.ext3 /dev/vdb
6. mount the disk mount /dev/vdb1 /mnt  and perform IO on mounted path(/mnt)

Hope this helps:


Regards
Sadhu


-----Original Message-----
From: Gaurav Aradhye [mailto:gaurav.aradhye@clogeny.com] 
Sent: 26 August 2013 14:53
To: dev@cloudstack.apache.org
Subject: Re: Writing to volume attached to VM

Hi,

Answering your questions in order c,a,b.

c) I am listing the partitions on the vm using fdisk -l command.
This is giving me following output.

 ['', 'Disk /dev/vda: 8589 MB, 8589934592 bytes', '255 head

s, 63 sectors/track, 1044 cylinders', 'Units = cylinders of 16065 * 512 =
8225280 bytes', '', ' Device Boot Start End Blocks Id System',

'/dev/vda1 * 1 13 104391 83 Linux', '/dev/vda2 14 1044 8281507+ 8e Linux LVM', '', 'Disk /dev/vdb: 1073 M

B, 1073741824 bytes', '16 heads, 63 sectors/track, 2080 cylinders', 'Units = cylinders of 1008 * 512 = 516096 bytes', '']


As you can see two disks /dev/vda and /dev/vdb are listed.

This output remains the same after attaching a volume to the vm.


a) As I am not able to identify any new partition, not able to detect the exact partition that needs to be mounted.

This is where I need help. How to identify the volume partitions and mount them?


b) Once the device is identified, it can be mounted using mount command.
Right now it is mounting the root disk partitions.


Firing all these commands to using remoteSSHClient of vm.



Regards,
Gaurav


On Mon, Aug 26, 2013 at 2:16 PM, Prasanna Santhanam <ts...@apache.org> wrote:

> On Mon, Aug 26, 2013 at 02:08:19PM +0530, Gaurav Aradhye wrote:
> > Hi all,
> >
> > Can you guide me on how to write on the external volume (DataDisk)
> attached
> > to a VM?
> >
> > I am trying to mount the partition, but the list of partitions 
> > before and after attaching the volume to vm, remains the same, so I 
> > am unable to detect which partition has been added.
>
> How do you
> a) identify the device on which the disk is available to be mounted
> b) mount the formatted device to your VM
> c) list the partitions/disks
>
> Some commands on how you do this will help.
>
> >
> > Has anybody done this before through test case?
> >
> > Regards,
> > Gaurav
>
> --
> Prasanna.,
>
> ------------------------
> Powered by BigRock.com
>
>

Re: Writing to volume attached to VM

Posted by Gaurav Aradhye <ga...@clogeny.com>.
Hi,

Answering your questions in order c,a,b.

c) I am listing the partitions on the vm using fdisk -l command.
This is giving me following output.

 ['', 'Disk /dev/vda: 8589 MB, 8589934592 bytes', '255 head

s, 63 sectors/track, 1044 cylinders', 'Units = cylinders of 16065 * 512 =
8225280 bytes', '', ' Device Boot Start End Blocks Id System',

'/dev/vda1 * 1 13 104391 83 Linux', '/dev/vda2 14 1044 8281507+ 8e Linux
LVM', '', 'Disk /dev/vdb: 1073 M

B, 1073741824 bytes', '16 heads, 63 sectors/track, 2080 cylinders', 'Units
= cylinders of 1008 * 512 = 516096 bytes', '']


As you can see two disks /dev/vda and /dev/vdb are listed.

This output remains the same after attaching a volume to the vm.


a) As I am not able to identify any new partition, not able to detect the
exact partition that needs to be mounted.

This is where I need help. How to identify the volume partitions and mount
them?


b) Once the device is identified, it can be mounted using mount command.
Right now it is mounting the root disk partitions.


Firing all these commands to using remoteSSHClient of vm.



Regards,
Gaurav


On Mon, Aug 26, 2013 at 2:16 PM, Prasanna Santhanam <ts...@apache.org> wrote:

> On Mon, Aug 26, 2013 at 02:08:19PM +0530, Gaurav Aradhye wrote:
> > Hi all,
> >
> > Can you guide me on how to write on the external volume (DataDisk)
> attached
> > to a VM?
> >
> > I am trying to mount the partition, but the list of partitions before and
> > after attaching the volume to vm, remains the same, so I am unable to
> > detect which partition has been added.
>
> How do you
> a) identify the device on which the disk is available to be mounted
> b) mount the formatted device to your VM
> c) list the partitions/disks
>
> Some commands on how you do this will help.
>
> >
> > Has anybody done this before through test case?
> >
> > Regards,
> > Gaurav
>
> --
> Prasanna.,
>
> ------------------------
> Powered by BigRock.com
>
>

Re: Writing to volume attached to VM

Posted by Prasanna Santhanam <ts...@apache.org>.
On Mon, Aug 26, 2013 at 02:08:19PM +0530, Gaurav Aradhye wrote:
> Hi all,
> 
> Can you guide me on how to write on the external volume (DataDisk) attached
> to a VM?
> 
> I am trying to mount the partition, but the list of partitions before and
> after attaching the volume to vm, remains the same, so I am unable to
> detect which partition has been added.

How do you 
a) identify the device on which the disk is available to be mounted
b) mount the formatted device to your VM
c) list the partitions/disks

Some commands on how you do this will help.

> 
> Has anybody done this before through test case?
> 
> Regards,
> Gaurav

-- 
Prasanna.,

------------------------
Powered by BigRock.com


Re: Writing to volume attached to VM

Posted by Wei ZHOU <us...@gmail.com>.
What is OS of your vm?
Does it support acpi hotplug?


2013/8/26 Gaurav Aradhye <ga...@clogeny.com>

> Hi all,
>
> Can you guide me on how to write on the external volume (DataDisk) attached
> to a VM?
>
> I am trying to mount the partition, but the list of partitions before and
> after attaching the volume to vm, remains the same, so I am unable to
> detect which partition has been added.
>
> Has anybody done this before through test case?
>
> Regards,
> Gaurav
>