1

After I chose a Xen VPS provider, they said me that Xen doesn't let them downgrade resources/hardware so, because of this I can't downgrade my plan. I think that this limitation is strange... Can you confirm that this limitation exist (or not) in Xen software/platform?

If the limitation doesn't exist, why do you think that the VPS haven't configured it?

If the limitation exist, how Xen can compete with other virtualization softwares?

P.S.: As someone have downvoted me... I would like to say that I googled it and I haven't found the answer.

P.S. 2: My question isn't related with licensing. It is a question about a feature of Xen

P.S. 3: The VPS provider sells packages. The packages differ from CPU, memory, bandwidth, HD and maybe something more.

Thanks in advance!

Claudio
  • 87
  • 8
  • Sign up for a new plan, move the data over, cancel the old one? – ceejayoz Sep 30 '15 at 21:04
  • @ceejayoz, I don't think that is a good procedure for a good virtualization tool. Do you think so? – Claudio Oct 01 '15 at 00:56
  • I think being able to do that easily indicates you've got good configuration management and disaster recovery procedures in place. – ceejayoz Oct 01 '15 at 01:25
  • But this don't let me downgrade instantaneously neither keep the IP address that is a very important asset – Claudio Oct 01 '15 at 10:42
  • @ceejayoz, if you know Xen, please let me know if this limitation really exist. Thanks! – Claudio Oct 01 '15 at 10:57
  • Possible duplicate of [Can you help me with my software licensing issue?](http://serverfault.com/questions/215405/can-you-help-me-with-my-software-licensing-issue) – Rob Moir Oct 01 '15 at 12:29
  • @Claudio Does it matter if it exists? Your host won't do it. – ceejayoz Oct 01 '15 at 13:39
  • @ceejayoz, if it possible I will ask them to implement it. They already have it for OpenVZ – Claudio Oct 01 '15 at 15:51
  • @RobM, my question isn't related with licensing. It is a question about a feature of Xen – Claudio Oct 01 '15 at 15:53

4 Answers4

4

Disk space: Shrinking a block device without first shrinking the filesystem would most likely destroy the filesystem. As the filesystem is most likely (I don't have enough information on your plan) not managed by your hoster, they can't just do that.

CPU: Xens management interface allows to lower the amount of assigned vcpus with xm vcpu-set.

Memory: The same goes for memory with xm mem-set. But with this one, it's not a good idea to do it. I'm going to quote the manpage of xm here:

Because this operation requires cooperation from the domain operating system, there is no guarantee that it will succeed. This command will definitely not work unless the domain has the required paravirt driver.

Warning: there is no good way to know in advance how small of a mem-set will make a domain unstable and cause it to crash. Be very careful when using this command on running domains.

Shrinking CPU / Memory would be completely unproblematic if they were to just restart your VPS on the Xen Host (Dom0), resulting in a small downtime.

Marco
  • 415
  • 1
  • 3
  • 16
3

This is actually a great question!

OpenVZ is an operating-system-level virtualisation technology, where each node shares the resources of the main host. In OpenVZ, administrator can just change a setting, and a different set of resources would be provided to the user as a matter of course. That's why almost all hosters (including yours as you mention in your comments) implement upgrades and downgrades for OpenVZ, because changing the process and memory allocations is alike doing a change with the getrlimit, setrlimit(2) system calls, and changing the disc size is alike doing quotactl(2) system call. If you're not familiar with these system calls to understand the allegory, it's enough to look at the HISTORY section to see that they've existed long before Linux was created -- that's how primal, basic and risk-free they are. (OpenVZ has their own way of doing these things, but it's basically the exact same concept.)

Xen, on the other hand, is a full virtualisation of a typical hardware. Changing memory in Xen is alike physically adding or removing the memory modules -- would you ever do that to a running system, and expect for the software to be able to handle it? Same for processors. Same for HDD. So, big deal, just shut it down first, right? Well, yes, that's possible and totally fine in regards to the memory and the CPU, but the HDD is different, as it holds the data you'd like to preserve.

How is HDD different? In OpenVZ, the HDD you see is just a subset of the actual files from an existing host filesystem, basically; if you have no files, it takes no size; and all limits are effectively soft. In Xen, it'd be the actual filesystem, backed by a file of a certain size on the host, same size as your virtualised disc.

Let's forget virtualisation for a minute. Now, if you ever did a verbatim copy (with dd(1)) of a smaller HDD to a larger HDD, you'd know that the results would appear identical, without showing any disc space increase. That's because you're copying the actual filesystem and the disklabel(5) of the disc verbatim. If you then wanted to use more space in the same filesystem, you'd have to first edit the disc's MBR partition with fdisk(8), then disklabel with disklabel(8), and only then call growfs(8) to actually increase the size of the filesystem. The filesystem itself contains various metadata throughout the whole disc, so, it has to be grown and shrank with a special command. If you look at the manual page, you'll notice that growfs itself is a much more modern invention (might even be a catchup to GNU/Linux!), and, at least in the BSD world, it's still missing a requisite "shrinkfs".

Now, back to Xen. The HDD of your VPS is likely backed by a single file of a specific size on the underlying Xen host. In order to shrink it, you'd first have to shrink the underlying filesystem within your VPS (luckily, unlike ffs/ufs in *BSD, shrinking actually is supported in Linux for ext2/ext3 etc), then worry about the disklabel/fdisk, as applicable. Only then could the Xen hosting provider truncate the underlying file that backs your HDD.

Suffice it to say, it's all quite possible, and Linode, for example, does automate all of these things (including automatically shrinking and growing your filesystem as needed, without any intervention from your side). But, needless to say, all of this does sound much more complicated than just making a system call (which doesn't really have to do anything other than modify a variable and restart a process), doesn't it?

P.S. Quite often, hosters specifically refuse to downgrade the pricing on older orders, telling the customer to re-order instead, because they know that not everyone will bother to go into such hassle just to save a few roubles here and there. And for the hoster, that's extra revenue.

However, in terms of keeping your IP address, you might enquire with your hoster if it'd be possible to re-assign your old IPv4 address to your new server once you finish the migration. If they're not willing to offer anything like that, either, then I'd suggest you strongly consider migrating to their competitor.

cnst
  • 12,948
  • 7
  • 51
  • 75
  • @crist, thanks for the good answer! I want to resell the VPSs providing premium services. I would like to have a provider that has a good and fast support. I would like Xen or KVM to have a better isolation from other VPSs. I also would like to have a VPS that supports resellers. I think that this support should come as a discount. Also would be interesting to have services like DDos protection. Some of my clients may need to have periods of high traffic. So, this is the reason that I want the downgrades. Do you suggest a VPS provider that have what I need and has plans starting from 5US$? – Claudio Oct 05 '15 at 11:33
  • 1
    You want a lot of premium features and you want to pay a tiny amount for the service. Good luck with that. – Dan Pritts Oct 05 '15 at 19:04
  • 1
    @Claudio, if you want free DDoS at 5$/mo, the only provider that really offers that would be OVH.ca, their 2016 line of KVM VPS is ridiculously cheap -- 3,49USD/mo for 2GB RAM / 10GB SSD -- but it doesn't support IPv6, and overall they do a lot of things differently than the rest of the top providers (whether that's for better or worse). I maintain a short list of cheap dedi providers over at http://dedi.su/, hetzner and online are some of the best dedi offers you could find if you hate OVH. With a dedi, you could splice your own server into individual KVM instances whichever way you want. – cnst Oct 06 '15 at 07:52
2

There is a lot of unknowns in your post - when you say downgrade, do you mean reduce CPU power, decrease amount of ram, shrink disk size, limit network?

It is very possible the provider is correct in stating they can not simply downgrade your machine, if you're looking for a smaller CPU footprint. Say you have an Ubuntu 14.04 Virtual Machine on a Xen cluster version 6.2. This cluster CPU is 2ghz. Say you don't want to pay for more than 1ghz of processing power, and you request a downgrade.

It's possible they have a Xen pool with 1ghz processors, but instead of being something like 6.2, it's version 5.6 - which is incompatible with Ubuntu 14.04, so it could not be moved to the older cluster with slower CPU speeds. A new machine could be built on the slower machine, but a simple move between pools is not something that could be accomplished.

With Xen, you can't just say 'only give my machine 1ghz of CPU power' the same way RAM can be increased/decreased with a few quick commands. The CPU is virtualized from what the host machine has, and can't really be manipulated in that way using Xen. There are ways to say how many cores/sockets you give a virtual machine, but that won't reduce the speed of your CPU, just how many cores are exposed to your node.

Without knowing more about what you're wanting to downgrade and/or what you're trying to go between from the providers side, that's about as detailed as I can get - but it is very possible this could be one of many scenarios the provider has.

  • Thanks for the answer! The VPS provider sells packages. The packages differ from CPU, memory, bandwidth, HD and maybe something more. The packages increase CPU as the number of CPUs. For example, in the most basic package it is 1 CPU and the better one is 2 CPUs... I would like to downgrade from one package to another, so I think you said that it is possible – Claudio Oct 05 '15 at 10:55
  • 1
    In theory it is very much possible, but this is not taking into account the configuration setup the provider is using. It is possible they have automated scripts built to provision hosts one time, not alter them, and to 'downgrade' they build you a new host. It is possible they can't downgrade you with the tools they have, it would be something at a deeper level that maybe they do not support or want to offer, because it would go outside of their set of tools. In the end, its up to the provider and what tools they are providing their staff, how they structure things. – Censored P. Censored Oct 07 '15 at 19:17
2

Xen creates .cfg configuration file for every guest (called DOMU in /etc/xen/DOMAIN.cfg) where it is possible to change parameters including the number of virtual cpus, initial ram when the VPS starts and maximum ram when the VPS is running.

If someone changes the parameters in the cfg file from this Domu and restart the VPS the new parameters are applied.

Reference: http://wiki.xenproject.org/wiki/Xen_3.x_Configuration_File_Options

I must mention that it is slightly more complicated to increase the storage space (from SSD or HD) for a VPS running on XEN. In this case, the admin has to shut down the vps, add zeros at the end of the virtual server file with dd command line, check everything is allright & restart.