Disk partitioning- Vmware Linux guest
-
@Ambarishrh said:
I am still learning about LVM, one of my search took me to a site where this was explained!
Let me test this and i might need some help/advice on this.
LVM is volume management. It is a basic form of storage virtualization used on all enterprise operating systems. AIX, Solaris, Windows, Linux, FreeBSD... they all use volume management as a very important abstraction layer between the file system and the block storage. It is what enables snapshots, partition modification and more in every one of those OSes. It's not really something that should generally come up as a topic for not using. There are cases for not uses it, but very few.
Think of volume management like virtualization. It is there to abstract raw interfaces and to provide flexibility for the unknown. Like virtualization, you generally avoid it only when you have a strong, clear technical reason why it is a problem. By default, always use it. Never ask "is it needed", you don't use it because it is necessary but because it is important. You only don't use it when you need to not use it.
-
This says you don't need a reboot for resizing. So if i understood this correctly, in my case VMWare can increase disk space on the fly, and then using LVM i make that space available to the volume group and then can be used to increase the space on the server with resize2fs.
-
@Ambarishrh said:
This says you don't need a reboot for resizing. So if i understood this correctly, in my case VMWare can increase disk space on the fly, and then using LVM i make that space available to the volume group and then can be used to increase the space on the server with resize2fs.
Correct, LVM is on the fly, no reboots involved.
-
With LVM you have the power to easily have multiple partitions for whatever needs you have. This lets you choose different filesystems as needed, as well. You can mix and match filesystems and features for speed, security, flexibility, etc. You can do encryption on a volume rather than on the entire system which is much more powerful, you can use XFS where it is useful, BtrFS where you want, EXT4 when needed... whatever. You can turn on quotas or compression selectively instead of globally.
-
I am planning to have the / and /var with LVM ext4, hope i can set only these two as LVM. does that make sense?
-
@Ambarishrh said:
I am planning to have the / and /var with LVM ext4, hope i can set only these two as LVM. does that make sense?
You make a partition that is LVM and then everything under that is the additional volumes. /boot and swap don't go on LVM.
-
I completed a test server with LVM. Did a split of /var on a separate disk and also moved /home to that, so that if something fills up this / doesn't get affected.
Overall it was very easy to extend the disk space and was a very good experience. Thanks once again @scottalanmiller
-
@Ambarishrh said:
I completed a test server with LVM. Did a split of /var on a separate disk and also moved /home to that, so that if something fills up this / doesn't get affected.
Overall it was very easy to extend the disk space and was a very good experience. Thanks once again @scottalanmiller
Another good thing to do is leave a small amount of space free (enough to cover the diff) so that you can do a snapshot of the LVM. If you update and it borks something you can revert to the snapshot, or even export the snapshot for a backup.
Since it's on VMware it's not that big of a deal because you have the snapshots for the vm itself, however on a physical machine it's useful.
-
regarding snapshots, this is what i heard from our hosting provider support team.
He says "big rule.
DO NOT LEAVE SNAPSHOTS AROUND.
if it exists for >48 hours, you're doing it wrong.
I have countelss stories of customers who made a snapshot forgot about it
3 months later they do a reboot or something and vmware consolidates the disk
we had a customer with a mission critical vm offline for >24 hours because it took 2 days to consolidate their data
(was like a 4tb vm)
snapshots are intended for short term use only" -
@Ambarishrh said:
regarding snapshots, this is what i heard from our hosting provider support team.
He says "big rule.
DO NOT LEAVE SNAPSHOTS AROUND.
if it exists for >48 hours, you're doing it wrong.
I have countelss stories of customers who made a snapshot forgot about it
3 months later they do a reboot or something and vmware consolidates the disk
we had a customer with a mission critical vm offline for >24 hours because it took 2 days to consolidate their data
(was like a 4tb vm)
snapshots are intended for short term use only"Oh ya these are just for short term. For example if you update and it screws something up you can revert. Once you test and make sure it's ok then delete it. I don't know how VMware does snapshots, but with LVM you can also export it. So you can take the snapshot and save it to a file, and if an issue does come up later down the road, you can just dd the file to the LVM again.
-
@johnhooks said:
@Ambarishrh said:
I completed a test server with LVM. Did a split of /var on a separate disk and also moved /home to that, so that if something fills up this / doesn't get affected.
Overall it was very easy to extend the disk space and was a very good experience. Thanks once again @scottalanmiller
Another good thing to do is leave a small amount of space free (enough to cover the diff) so that you can do a snapshot of the LVM. If you update and it borks something you can revert to the snapshot, or even export the snapshot for a backup.
Since it's on VMware it's not that big of a deal because you have the snapshots for the vm itself, however on a physical machine it's useful.
However, it IS useful to be able to do snapshots programatically and uniformly from inside of the OS. There are times that this would make sense and you can do it in a uniform way across physical and virtual machines, across all filesystems, across all hypervisors.
-
@Ambarishrh said:
regarding snapshots, this is what i heard from our hosting provider support team.
He says "big rule.
DO NOT LEAVE SNAPSHOTS AROUND.
if it exists for >48 hours, you're doing it wrong.
I have countelss stories of customers who made a snapshot forgot about it
3 months later they do a reboot or something and vmware consolidates the disk
we had a customer with a mission critical vm offline for >24 hours because it took 2 days to consolidate their data
(was like a 4tb vm)
snapshots are intended for short term use only"That is generally true, on VMware. That's a VMware shortcoming. If you are making lots of snaps and just letting them sit around, Vmware isn't going to be happy and eventually will fail, I've seen it.
If you are on more advanced systems like Scale, you do not have these kinds of limitations. It's not an intrinsic nature of snapshots to need to be very short term, it is the nature of how VMware implemented them.
Even if your snaps don't cause problems down the road, you would still probably not want to just collect them at random. But keeping long term rollbacks is not a big issue. XO even has rolling backups as a standard feature on XenServer.
-
@johnhooks said:
Oh ya these are just for short term. For example if you update and it screws something up you can revert. Once you test and make sure it's ok then delete it. I don't know how VMware does snapshots, but with LVM you can also export it. So you can take the snapshot and save it to a file, and if an issue does come up later down the road, you can just dd the file to the LVM again.
Same with VMware. The creation of snapshots is, under the hood, how their backup API works. When tools like Veeam or Unitrends talk to VMware and tell it that they want to take a backup, Vmware takes a snap for them, exports it to them, then deletes the snap "immediately" so you don't even know that it happened that way.
-
@scottalanmiller said:
@johnhooks said:
Oh ya these are just for short term. For example if you update and it screws something up you can revert. Once you test and make sure it's ok then delete it. I don't know how VMware does snapshots, but with LVM you can also export it. So you can take the snapshot and save it to a file, and if an issue does come up later down the road, you can just dd the file to the LVM again.
Same with VMware. The creation of snapshots is, under the hood, how their backup API works. When tools like Veeam or Unitrends talk to VMware and tell it that they want to take a backup, Vmware takes a snap for them, exports it to them, then deletes the snap "immediately" so you don't even know that it happened that way.
Good to know. I've never needed to use VMware so I have no experience with it at all.
-
@johnhooks said:
Good to know. I've never needed to use VMware.
And probably you never will.
-
@scottalanmiller said:
@johnhooks said:
Good to know. I've never needed to use VMware.
And probably you never will.
Hopefully not, but it seems a ton of places around here use it.
-
@Ambarishrh said:
i know there will be questions on why vmware. (that is decided already based on several factors and management decision).
Why not XenServer? =P
-
Well, we are moving from Xen to VmWare!
-
@Ambarishrh said:
Well, we are moving from Xen to VmWare!
That's just sad. Huge loss of features, 20% more hardware needed, loss of community support levels (they still exist, just aren't as good), massive increase in monetary loss. Why would anyone go from the best to the worst voluntarily?
-
Anyways, i won't lose the joy of using xen as i just upgraded my home server xen and added XO