Skip to content

Instantly share code, notes, and snippets.

Avatar

Samuel Ortiz sameo

View GitHub Profile
View containerd-devicemapper.md

Notes

We use /dev/loop0 as the physical media, backed by an empty, 8G image:

dd if=/dev/zero of=lvm-loop.img bs=100M count=80
losetup -fP lvm-loop.img
losetup -a
/dev/loop0: [0053]:4207657 (/home/samuel/devlp/containers/devicemapper/lvm-loop.img)
View main.rs
use std::collections::HashMap;
use std::env;
use std::fs;
use std::io;
use std::io::BufRead;
fn get_vmm_overhead(pid: u32, guest_memory_size: u32) -> HashMap<String, u32> {
let smaps = fs::File::open(format!("/proc/{}/smaps", pid)).unwrap();
let reader = io::BufReader::new(smaps);
View migration-pr.md

rust-vmm dependencies

fa8003c3 Cargo: Update dependencies for the KVM serialization work

vm snapshot/restore

View kvm-tuning.md
View cfp-devoxxfr-virtualisation.md
Vous vous êtes toujours demandé ce qui se passe sous le capot des outils qui gèrent vos machines virtuelles locales (Virtualbox par exemple) ou sous celui d'un Hyperviseur (VMWare par exemple) ou encore pourquoi la tendance du moment consiste à encapsuler les conteneurs dans des VMs?

Venez découvrir avec nous les impacts de la virtualisation sur le CPU, le réseau, l'I/O, et comment les évolutions des technologies utilisées pour le CPU, le réseau et l'I/O ont fait évoluer la virtualisation.

Cette initiation vous donnera les bases nécessaires à une appréhension correcte de cet univers, vous permettant d'utiliser ou d'implémenter des solutions de ce type de manière plus efficace.
@sameo
sameo / cloud-hypervisor-minimal-vm.md
Last active Jan 14, 2020
Cloud Hypervisor minimal VM build
View cloud-hypervisor-minimal-vm.md

Cloud Hypervisor build

cargo build --no-default-features --release && sudo setcap cap_net_admin+ep ./target/release/cloud-hypervisor

This will create a VMM that only emulates the serial and I/O APIC devices

Initramfs

View vm-create.sh
#!/bin/bash
curl --unix-socket $1 -i \
-X PUT 'http://localhost/api/v1/vm.create' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"cpus":{"cpu_count": 4},
"kernel":{"path":"/opt/kata/vmlinux-virtio-fs-v0.3-54"},
"cmdline":{"args":"console=hvc0 reboot=k panic=1 nomodules i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd root=/dev/vda3"},
View interrupt.md
/// Trait to manage interrupt sources for virtual device backends.
///
/// The InterruptManager implementations should protect itself from concurrent accesses internally,
/// so it could be invoked from multi-threaded context.
pub trait InterruptManager {
    /// Create an [InterruptSourceGroup](trait.InterruptSourceGroup.html) object to manage
    /// interrupt sources for a virtual device
    ///
    /// An [InterruptSourceGroup](trait.InterruptSourceGroup.html) object manages all interrupt
View cloud-hypervisor-migration.md

Terminology

  • Migratable Component: A VMM component that declares itself as migratable. Examples of migratable component: A virtio device, a vCPU, RAM, etc.

  • Migratable Component State: A migratable component state...

  • Migrator

HTTP API

View memory.py
#!/usr/bin/env python3
#
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Utilities for measuring memory utilization for a process."""
import time
import sys
from subprocess import run, CalledProcessError, PIPE
from threading import Thread