Preserving onions and retaining their qualities is a very difficult challenge.
Most known effective methods require freezing, which requires reliable power.
The main problem is that well tested recipes for preservation (pickling or canning) from trusted, research-based sources like government agencies or university extensions are extremely difficult to locate. You will have to assess your tolerance of risk in using recipes that you do find.
Freezing
If you have reliable power to maintain a freezer, onions can be frozen. The University of Nebraska Extension recommends washing, peeling and chopping the onions into about 1/2 inch (1 cm) pieces. Freeze in single layer freezer bags, making it easy to break off a portion.
Frozen onions are best used in cooked dishes.
Should last 3-6 months (in terms of quality; they will be safe indefinitely if continuously frozen).
Canning
Onions are a low acid food, and so require pressure canning for preservation. Make sure to locate a trustworthy recipe.
Canning and Preserving for Dummies offers a detailed recipe online, but I cannot verify that it is backed by quality safety research.
Properly canned onions should last a year, and will be best suited for cooked dishes.
Caramelized or Made into Jam and Canned
Again, onions are a low acid food, safe preservation requires pressure canning and a safe recipe from a qualified source such as a university or government agency.
If you can find a recipe you trust, they should last a year, but will of course have a substantially different flavor and texture from raw onions.
The problem is that I am unable to find a single recipe whose pedigree I would trust as showing that it is backed by the proper research to indicate its safety.
Pickling
It is difficult to find reliable shelf stable pickle recipes from a trustworthy source for full sized onions. Most are intended to tiny (1-2 cm) onions.
If you can locate a trustworthy pickling recipe (a true canned pickle, heat treated, or a true fermented pickle) from a reputable source like a university or government agency, this may be an option, but the onions would of course be pickled, and have a different flavor and be much more acidic.
Properly pickled onions should last a year, but the challenge is finding a safe recipe, and pressure canning is a must.
Dehydrating
Dehydrating should be a good option in theory, but with home equipment, you are unlikely to desiccate the onion to a safe level for shelf stability. The National Onion Association recommends freezing dehydrated onion, which may or not be an option.
Cool Dry Storage
Onions can naturally be stored, if properly cured (dried and prepared for storage), for many months. Unfortunately, you may not be able to control how well they were cured after being harvested.
Properly cured onions, if kept in a cool place (around 40 F, 4 C) should last 10-12 months (which is how they are stored commercially for sale at retail year round). Again, this may not be feasible.
Best Answer
Pasta freezes well if you do it right. In fact, I know of a very famous Italian restaurant in NY that freezes their pasta which they make fresh everyday. They cycle through new pasta every three days and they serve A LOT of pasta. The chef dared me to tell the difference. And he's right. 99.9% of people can't tell.
To freeze, bundle into small amounts (e.g. wrap around your hand), enough for single servings. Put on a tray, with a little semolina flour or cornmeal dusted underneath (to prevent sticking). Keep each bunch separate, they shouldn't touch. Put into freezer. Once frozen (few hours), transfer to a ziplock freezer bag. It will keep for several months, but I'd eat it within one month.
To use, dump straight into boiling water. Make sure you have a big pot of water at a full boil (because the frozen pasta will drop the temperature more than unfrozen). Stir immediately.
This works very well.