For me, isolating the breakage of one service from another is a strong motivation to run containers and virtual machines. Upgrade some, let all others remain unaffected.
MicroVM.nix ships its own tooling for updating your independent NixOS systems: the microvm
command. All that it is doing consists of maintaining the source flakeref in /var/lib/microvms/*/flake
so that updates can be built from somewhere, and then creating the /var/lib/microvms/*/current
symlink to the config.microvm.declaredRunner
. Are these internals already, or should I start documenting them?
At c3d2.de we just switched from Proxmox to a setup that consists of MicroVMs on NixOS. It is very pleasing to see my cheap but NixOS-native “virtualization solution” arriving at more deployments. I really wished for this setup to become much more convenient than what we had before.
Both Initial deployment and updates from your local working state of this infrastructure’s flake are conducted with a nix run .#microvm-update-$hostname
that will run something that looks like this:
nix copy --to ssh://root@${server} ${self}
ssh root@${server} -- bash -e<<EOF
mkdir -p /var/lib/microvms/${name}
cd /var/lib/microvms/${name}
nix build -L -o current \
${self}#nixosConfigurations.${name}.config.microvm.declaredRunner
echo 'git+https://gitea.c3d2.de/c3d2/nix-config?ref=flake-update' > flake
systemctl restart microvm@${name}.service
EOF
First, we copy the current flake to the server so that it can build from it, which is then done via ssh. Afterwards, the flake
file is written so that microvm -u
later works, and finally the new or updated MicroVM is restarted. I simplified a bit. The MicroVM can also be built locally or with a remote builder. The service shouldn’t be restarted if there was no change to the current
symlink. There is not only plenty of room but really an open space to design these workflows to your own preferences and work style.
To prepare all updates from stable NixOS for our infrastructure, we’ve got a systemd.timer that runs nix flake update --commit-lock-file
and pushes to that flake-update
branch which is then prebuilt by our local Hydra, saving us a lot of time once we run microvm -u
. We can even fetch JSON from the Hydra API to obtain the resulting store path which we can then just nix copy
onto target server so that /var/lib/microvms/*/current
can get updated, relieving you of that extra Nix evaluation. If you made ssh a requirement for your MicroVMs and also ran with a /nix/store
mounted from the host, you could even switch to the new system without rebooting the MicroVM.
The included microvm
tool still works:
(stderr omitted for two lines of embarassing warnings.)
Composing infrastructure with NixOS is fun!
Comments
October 26, 2022 13:17
I wanted to many thanks because of this great read!! I definitely enjoying every bit of it I maybe you have bookmarked to see new stuff you post. architectural refuse systems parts
October 27, 2022 13:38
It was a very good post indeed. I thoroughly enjoyed reading it in my lunch time. Will surely come and visit this blog more often. Thanks for sharing. globe technologies fusible link
November 1, 2022 14:07
fomajob
Rapidly this particular amazing web site ought to irrefutably turned out to be acknowledged inside all the website many people, because of the diligent content articles or even evaluations or even suggestions. seo hong kong
January 17, 2023 12:51
fomajob
Buy Gold, Platinum, Palladium and Silver Invest in precious metals and get best prices for your 18,22, 24 Carat Gold bars and coins. Buy Gold
November 13, 2022 10:03
Thanks for your insight for your fantastic posting. I’m exhilarated I have taken the time to see this. It is not enough; I will visit your site every day. избор на домоуправител софия
December 12, 2022 11:48
as
She’s a confused woman who gets involved in all the action and later on falls for Roy. https://rajagaccor.thechapblog.com/17154690/official-agent-for-the-trusted-rajagacor-online-gambling-list-2022
December 15, 2022 09:07
SHAHBAZANSARI
Find out these pointers read on and learn to know how to submit an application doing this that you policy your corporation today. alertpay 5d10s68975
December 17, 2022 13:53
as
Exactly what you’re just saying entirely authentic. Actually , i know in which will have to the same, however , I simply think you put it in a fashion that everybody is able to comprehend. Also i like the images you spend at this point. They can fit consequently perfectly with what you are telling. Instant messaging certainly you may get to many people in what you have need to say. https://hesgoal.is/
January 10, 2023 11:28
as
I’m impressed, I have to admit. Truly rarely should i encounter a blog that’s both educative and entertaining, and let me tell you, you’ve got hit the nail to the head. Your thought is outstanding; ab muscles a thing that too little people are speaking intelligently about. We are very happy that I came across this at my try to find some thing about it. 먹튀없는 안전공원
January 11, 2023 10:46
as
I like most of the reports, I truly treasured, I’d prefer specifics concerning this, considering it is especially fine., Thanks a lot to get going over. 안전토토사설토토
January 11, 2023 15:26
as
I enjoy your own personal distribute. It really is fantastic to ascertain someone describe inside terms inside the heart along with quality concerning this crucial matter could possibly be quickly seen. Sladjana Milojev
December 20, 2022 11:59
european vacations are very exciting sepcially if you got to visit many places at once, slot online
December 21, 2022 12:34
SHAHBAZANSARI
hello!,I like your writing so a lot! proportion we keep in touch more approximately your article on AOL? I require a specialist in this space to unravel my problem. May be that’s you! Looking ahead to peer you. slot online
December 24, 2022 11:05
ASA
Hello there, just became aware of your blog through Google, and found that it is truly informative. I’m going to watch out for brussels. I’ll be grateful if you continue this in future. Numerous people will be benefited from your writing. Cheers! big boobs sex doll
December 29, 2022 12:10
AS
There are pros and cons to taking this approach. But you can make the child custody hearing work to your advantage by knowing what the court expects from you as a parent. 강남아이스
December 31, 2022 07:04
asa
Some genuinely interesting details you have written. Assisted me a lot, just what I was looking for : D. 아이스작대기
December 31, 2022 07:59
SHAHBAZANSARI
You’ve made various nice points there. I did specific search terms around the matter and found mainly individuals will believe your site ключар София
January 1, 2023 14:33
cf
Hello just wanted to give you a quick heads up. The text in your article seem to be running off the screen in Internet explorer. I’m not sure if this is a format issue or something to do with browser compatibility but I figured I’d post to let you know. The design and style look great though! Hope you get the issue fixed soon. Kudos nature good morning images
January 3, 2023 12:37
as
You’ll find it in addition a large set that we exceptionally savored researching. Will not be normal that come with the candidate to see or watch products. agen sbobet
January 4, 2023 15:04
fomajob
I just love to read new topics from you blog.,*-’- สล็อต โจ๊กเกอร์999
January 9, 2023 14:28
fomajob
Hi there, You have performed a great job. I’ll certainly digg it and in my opinion recommend to my friends. I am sure they will be benefited from this web site. 최고의안전놀이터
January 19, 2023 12:42
Airport Car Service
Do you need a luxury sedan for a corporate meeting, airport transfer, a special occasion stretch limo or party bus? Our Traveler’s Choice limo service DC provides professionally chauffeured limousine, luxury sedan, luxury SUVs, party buses, limo coaches and vans at extremely affordable rates. Airport Car Service
January 26, 2023 15:03
cf
Hello! I just now would choose to give a huge thumbs up for the fantastic info you might have here with this post. I will be returning to your site for more soon. Black Attorney
January 29, 2023 12:20
as
my dad is a massage therapist and he can really relieve minor pains and injuries’ German Rottweiler puppies for sale
February 9, 2023 13:40
fomajob
The Spirits of African oracle cards is a distinctly unique deck that profiles the archetypical energies venerated throughout the African tarot deck diaspora.
February 14, 2023 13:14
fgvdrgv
I have read a few good stuff here. Certainly worth bookmarking for revisiting. I wonder how much effort you put to make such a fantastic informative site. long island financial advisor
February 23, 2023 14:29
WDW
Get a loan for your a small business loans from 5,000 and up Working capital, equipment loans, line of credit, term loans.
March 1, 2023 11:36
fomajob
If you’re in need of garage door repair in Mission Viejo, look no further than Mission Viejo garage doors. Our licensed and experienced technicians provide high-quality repairs using the best replacement parts. We offer a warranty on our work, ensuring your satisfaction. Contact us today for all your garage door repair and maintenance needs.
March 12, 2023 17:00
Hey, this day is too much good for me, since this time I am reading this enormous informative article here at my home. Thanks a lot for massive hard work. tussionex cough syrup for sale
March 13, 2023 16:23
I have read your blog it is very helpful for me. I want to say thanks to you. I have bookmark your site for future updates. 에볼루션카지노
April 25, 2023 18:04
Calculate the Uk Gold Price Per Gram Get the gold rates today using our Gold price calculator 9 Karat, 18 Karat 22 and 24 Carat Gold Price London Gold Centre
April 28, 2023 15:46
Trees are an essential part of our environment, but sometimes they need to be removed due to various reasons such as age, disease, or structural issues. tree removal sydney is a complicated process that requires proper knowledge and expertise to perform safely and efficiently. If you need tree removal service in Sydney, Black Forest Tree Service is the right company to call.
April 30, 2023 10:09
The Tree Doctor is a leading tree removal service in Sydney, offering professional and reliable services to clients in the area. We understand the importance of trees and their contribution to the environment, but we also recognize the need for tree removal service in certain situations. Our experienced and skilled tree surgeons use the latest techniques and equipment to remove trees of any size with minimal disruption to your property or surrounding areas.
May 16, 2023 13:21
Make your wedding day unforgettable with the expert wedding videography services from Rayden Video Productions. Click here to see our portfolio and learn more.
June 13, 2023 12:59
AS
If you’re looking for a fence company Meridian ID , look no further than Askatu Construction. For over 20 years, we have been providing high-quality fence installation services to customers in the Treasure Valley area. We offer a wide variety of fencing options, including agricultural, cedar, chain link, molded/composite, vinyl, and wrought iron fences. Our fences are custom-built to fit your needs, ensuring that you get the exact fence you want. In this article, we will explore our fence installation services in Meridian, ID, and how we can help you get the fence of your dreams.
June 27, 2023 13:59
AS
Looking to Sell my house fast for cash in Lexington KY? We are the trusted Cash home buyers Lexington Kentucky in the area. No realtors, no fees, no commissions. Get a free fair cash offer from a local Lexington area buyer. Contact us at (859) 203-5760.
July 11, 2023 08:25
as
Dental Emergencies in Bern? We’re here for you! | Dentcenter is your trusted Notfallzahnarzt (Notfallzahnarzt Bern) in Bern. Our skilled team provides prompt and efficient Zahnarzt Notfall Bern services. Contact us at (031) 333 66 66 or (031) 333 66 61 for immediate assistance.
July 11, 2023 10:39
AS
At Been There Financial Planner in Ottawa, we understand that every client has unique financial needs and goals. That’s why we take the time to get to know you and your financial situation in depth before providing any advice. As a Fee only financial planner, we do not sell products or receive commissions, so you can rest assured that our advice is always in your best interest.
July 15, 2023 11:34
AS
Are you in need of a professional electrician in Brisbane and the Sunshine Coast? Look no further than Sparc Electrical, your trusted partner for top-quality electrical services. With a commitment to excellence, affordable pricing, and unmatched customer satisfaction, Sparc Electrical has established itself as a reliable name in the industry. Whether you require aircon installation, lighting upgrades, renovation electricians, real estate electricians, or commercial electricians, Sparc Electrical has got you covered.
July 16, 2023 13:26
AS
Are you searching for a trusted Zahnarzt Zürich can provide you with comprehensive dental care? Look no further! At the Weinberg, styleyoursmile offers holistic dental treatment from a single source. Led by the esteemed Dr. Jan Munzinger, a specialist in dental care, our practice caters to patients seeking professional and personalized solutions for their oral health needs. With our highly qualified dentists and state-of-the-art facilities, we are committed to helping you achieve a beautiful, healthy smile.
July 18, 2023 09:05
AS
Discover the future of Bitcoin with our comprehensive BTC price prediction guide for 2023, 2025, and 2030. Explore the potential price fluctuations, historical trends, and essential facts that could shape the cryptocurrency market. Click here to visit us and make informed decisions.
July 25, 2023 15:07
as
Discover the latest Enchante discounted price list, available balance units, and floor plans updated daily by the official developer sales team at NEWLAUNCHER. Book your viewing now and explore the captivating world of Enchante!
July 26, 2023 12:56
AS
Discover the brilliance of LED linear light fixtures at RDS, the top-notch LED linear light manufacturer in China. Explore their Smart Aluminum 8In1 LED Linear Light fixture, offering 2FT, 4FT, and 8FT options or customization. With 3-Power & 3-CCT Selectable features and Ugr<19 Light Direct, these fixtures provide comfortable illumination for commercial spaces. Click here to learn more about their cutting-edge products and services.
July 26, 2023 14:02
AS
Discover Praemando International, a leading provider of virtual executive assistants. Learn virtual assistantship can support your business growth and free up your time for more important tasks.
July 31, 2023 10:45
as
Unlock the potential of automated crypto trading with immediate edge, the leading autotrading application in the market. Sign up for your free trial and start making profits without hidden fees!
August 1, 2023 10:51
AS
To ensure that protect your drinking water remains free from harmful ‘forever chemicals,’ get in touch with Soft Pure Water System. You can reach them at (800) 496-6040 to schedule an immediate water test. Their dedicated team of experts is ready to assist you in selecting the best Kinetico water system to suit your specific needs. Don’t compromise on the health of your loved ones; explore more about Kinetico’s water filtration solutions and experience the peace of mind that comes with being protected by the finest water system available.
August 8, 2023 09:02
as
Elevate your dining experience with BIG Möbel’s exclusive catering furniture. From tischgestell to polsterbank, we offer inventory items of excellent quality to suit your style and budget. polsterbank
August 8, 2023 09:15
AS
Cool Air Technologies: AC Sales Orange County Premier AC Company Orange County. Offering AC Repair, AC Sales Anaheim, Services, Sales, and HVAC Replacement in Anaheim and Beyond. Click here to visit us now! AC Sales Anaheim
August 9, 2023 10:15
AS
Looking to BUY MODAFINIL without a prescription? Explore our comprehensive guide at LA Weekly and discover where you can purchase this potent nootropic online in 2023. Energize your body and enhance focus with Modafinil today!
August 16, 2023 13:43
as
Are you yearning for extra living space while simultaneously boosting your property’s value? Look no further than A-Z Property Improvement & Remodeling, your premier destination for Basement Finishing in Mississauga and the GTA. With 16 years of expertise, we’re your trusted partner in turning your basement into a stunning and functional area. Our skilled team of interior designers, building professionals, and renovation experts is committed to providing you with top-notch service that transforms your basement into a quality, comfortable, and inviting space for your family. Basement Finishing
August 19, 2023 08:20
AS
Dentcenter Dentists - Your Zahnarzt Bern for a healthy smile. Experience modern treatment concepts, comprehensive advice, and top-quality dental care with experienced dentists at the Dentcenter in Bern.
August 20, 2023 08:14
AS
Discover Regal Bathrooms, your trusted partner for top-quality Bathroom Renovations Canberra. With meticulous attention to detail and a comprehensive 7-year guarantee, we ensure a transformative and value-boosting renovation experience.
August 20, 2023 08:53
AS
Discover the science behind Acantha Pternas specialized orthotic insoles, designed to alleviate heel spur pain and absorb shock, leading you towards a life with fewer foot discomforts. Learn more about how heel spurs can hinder your daily activities and explore the realm of effective solutions.
August 21, 2023 07:42
AS
Welcome to our website, your one-stop destination for the most comprehensive coverage of Sportnachrichten and Krypto-Nachrichten. In an ever-evolving landscape where sports and cryptocurrency intersect, staying informed is key. We understand that avid enthusiasts like you are always hungry for the latest updates and insights, and that’s exactly what we aim to provide.
August 21, 2023 07:53
AS
The allure of international experiences combined with professional growth has never been more attainable. The J-1 Internship & Trainee Programs, administered by the United States Department of State, are designed to provide participants with an opportunity for cultural exchange and skill enhancement. Here at International Trainee Network (ITN), we’re dedicated to making this journey of a lifetime a reality. Whether you’re inclined towards hospitality internships usa or business programs, we offer comprehensive and customized solutions to help you thrive.
August 26, 2023 12:25
AS
Discover the exhilarating world of online slots at Okeplay777 – your trusted online slot gaming destination. Immerse yourself in the excitement of okeplay777, the premier online slot platform renowned for its unmatched gacor wins. Explore now and experience the pinnacle of online slot entertainment.
September 21, 2023 10:49
asdas
Lookhu is your go-to destination for free movies, TV series, and PPV events featuring your favorite celebrities, influencers, and personalities. Dive into a diverse range of genres, including horror movies, documentaries, action-packed series, and more. Visit Lookhu today to explore an exciting world fee tv of entertainment.