When ‘Dor Laor’ & ‘Avi Kivity’ stepped out of Red Hat, I was thinking, what is next ? 🙂 and it stands now on OSv with this mailing thread.. http://www.mail-archive.com/kvm@vger.kernel.org/msg95768.html
It claims “OSv, probably the best OS for cloud workloads! and OSv is designed from the ground up to execute a single application on top of a hypervisor, resulting in superior performance and effortless management”
For those who havent heard it, “OSv reduces the memory and cpu overhead imposed by traditional OS. Scheduling is lightweight, the application and the kernel cooperate, memory pools are shared. It provides unparalleled short latencies and constant predictable performance, translated directly to capex saving by reduction of the number of OS instances/sizes.”
The project comes from Cloudius Systems.
Obviously, running OSv under KVM was my first try..
Let me show how it went!.. The execution was held on ‘Fedora 19’ system. Nothing much to perform to launch OSv than Pekka pointed out in his github.
1) First of all lets download the OS image:
[Humble@localhost osv]$ wget http://cloudius.artifactoryonline.com/cloudius/simple/osv-releases/osv-v0.01.qcow2
*****
2013-09-17 15:36:57 (55.2 KB/s) – ‘osv-v0.01.qcow2’ saved [189267968/189267968]
2) Then you need to create a ‘qemu-ifup.sh’ script with below:
[Humble@localhost osv]$ ls
osv-v0.01.qcow2
[Humble@localhost osv]$ cat > qemu-ifup.sh << EOF
> #!/bin/sh
> echo SCRIPT, \$1
> brctl addif virbr0 \$1
> ifconfig \$1 up
> EOF
[Humble@localhost osv]$ chmod u+x qemu-ifup.sh
[Humble@localhost osv]$ ls
osv-v0.01.qcow2 qemu-ifup.sh
[Humble@localhost osv]$ cat qemu-ifup.sh
#!/bin/sh
echo SCRIPT, $1
brctl addif virbr0 $1
ifconfig $1 up
3) Make sure, you have loaded “KVM” modules in your Fedora 19 system:
[Humble@localhost osv]$ lsmod |grep kvm
kvm_intel 133627 0
kvm 439238 1 kvm_intel
[Humble@localhost osv]$
[Humble@localhost osv]$
4) Now run the VM by below command :
[Humble@localhost osv]$ sudo qemu-system-x86_64 -vnc :1 -gdb tcp::1234,server,nowait -m 2G -smp 2 \
> -chardev stdio,mux=on,id=stdio -mon chardev=stdio,mode=readline,default \
> -device isa-serial,chardev=stdio -drive file=osv-v0.01.qcow2,if=virtio,cache=unsafe \
> -netdev tap,id=hn0,script=qemu-ifup.sh,vhost=on -device virtio-net-pci,netdev=hn0,id=nic1 \
> -enable-kvm -cpu host,+x2apic
As soon as you ran above command, you can see guest booting :
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for Humble:
SCRIPT, tap0
acpi 0 apic 0
acpi 1 apic 1
APIC base fee00000
Loader Copyright 2013 Cloudius Systems
locale works
VFS: mounting ramfs at /
VFS: mounting devfs at /dev
ACPI: RSDP 0xfd950 00014 (v00 BOCHS )ACPI: RSDT 0x7fffe450 00034 (v01 BOCHS BXPCRSDT 00000001 BXPC 00000001)ACPI: FACP 0x7fffff80 00074 (v01 BOCHS BXPCFACP 00000001 BXPC 00000001)ACPI: DSDT 0x7fffe490 011A9 (v01 BXPC BXDSDT 00000001 INTL 20100528)ACPI: FACS 0x7fffff40 00040ACPI: SSDT 0x7ffff7a0 00796 (v01 BOCHS BXPCSSDT 00000001 BXPC 00000001)ACPI: APIC 0x7ffff680 00080 (v01 BOCHS BXPCAPIC 00000001 BXPC 00000001)ACPI: HPET 0x7ffff640 00038 (v01 BOCHS BXPCHPET 00000001 BXPC 00000001)RAM disk at 0x3ed0c000 (4096K bytes)
Initializing network stack…
Done!
eth0: ethernet address: 52:54:0:12:34:56
VFS: mounting zfs at /usr
zfs: mounting osv/usr from device /dev/vblk0.1
[I/26 dhcp]: Waiting for IP…
[I/309 dhcp]: Configuring eth0: ip 192.168.122.89 subnet mask 255.255.255.0 gateway 192.168.122.1
[I/309 dhcp]: Server acknowledged IP for interface eth0
stub dlclose()
OpenJDK 64-Bit Server VM warning: Can’t detect initial thread stack location – find_vma failed
device random not found
SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Warning: default mime table not found: /usr/lib/jvm/jre/lib/content-types.properties
vfork stubbed
____ _____
/ __ \ / ____|
| | | | (_____ __
| | | |\___ \ \ / /
| |__| |____) \ V /
\____/|_____/ \_/
[/]% Puma 2.5.1 starting…
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://0.0.0.0:8080
== Sinatra/1.4.3 has taken the stage on 8080 for development with backup from Puma
WoW! . You have a shell in 1/2 Seconds …
If I call above messages as ‘dmesg’ in traditional way, Did you notice ?
VFS: mounting ramfs at /
VFS: mounting devfs at /dev
…
VFS: mounting zfs at /usr
zfs: mounting osv/usr from device /dev/vblk0.1
As you are, I dont know which commands can be tried… so, I gave a try with ‘help’ first and it offered ‘help’ 🙂
[/]%
[/]% help
Try one of these commands with the -h or –help switch:
NAME DESCRIPTION
cat concatenate files and print on standard output
cd change the current working directory
dashboard
dhclient
env display the term env
filter A filter for a stream of map
help provides basic help
java Java application launcher
jdbc JDBC connection
jmx Java Management Extensions
jndi Java Naming and Directory Interface
jpa Java persistance API
jvm JVM informations
log logging commands
ls list directory contents
man format and display the on-line manual pages
md5sum
perf
pwd print name of current working directory
shell shell related command
sleep sleep for some time
sort Sort a map
system vm system properties commands
test
thread JVM thread commands
[/]%
[/]% system
usage: system COMMAND [ARGS]
The most commonly used system commands are:
gc call garbage collector
propls list the vm system properties
propset set a system property
propget get a system property
proprm remove a system property
freemem show free memory
totalmem show total memory
[/]%
[/]% system propls
NAME VALUE
——————————————————————————–
java.runtime.name OpenJDK Runtime Environment
sun.boot.library.path /usr/lib/jvm/jre/lib/amd64
java.vm.version 23.7-b01
jline.terminal com.cloudius.cli.OSvTerminal
java.vm.vendor Oracle Corporation
java.vendor.url http://java.oracle.com/
path.separator :
java.vm.name OpenJDK 64-Bit Server VM
file.encoding.pkg sun.io
sun.os.patch.level unknown
java.vm.specification.name Java Virtual Machine Specification
user.dir /
java.runtime.version 1.7.0_25-mockbuild_2013_07_27_13_36-b00
java.awt.graphicsenv sun.awt.X11GraphicsEnvironment
java.endorsed.dirs /usr/lib/jvm/jre/lib/endorsed
os.arch amd64
java.io.tmpdir /tmp
line.separator
java.vm.specification.vendor Oracle Corporation
os.name Linux
sun.jnu.encoding UTF-8
java.library.path /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/l
ib:/usr/lib
java.specification.name Java Platform API Specification
java.class.version 51.0
sun.management.compiler HotSpot 64-Bit Tiered Compilers
os.version 3.7
user.home
user.timezone GMT
java.awt.printerjob sun.print.PSPrinterJob
file.encoding UTF-8
java.specification.version 1.7
java.class.path /usr/mgmt/web-1.0.jar
user.name osv
java.vm.specification.version 1.7
java.home /usr/lib/jvm/jre
sun.arch.data.model 64
user.language en
java.specification.vendor Oracle Corporation
awt.toolkit sun.awt.X11.XToolkit
java.vm.info mixed mode
java.version 1.7.0_25
java.ext.dirs /usr/lib/jvm/jre/lib/ext:/usr/java/packages/lib/e
xt
sun.boot.class.path /usr/lib/jvm/jre/lib/resources.jar:/usr/lib/jvm/j
re/lib/rt.jar:/usr/lib/jvm/jre/lib/sunrsasign.jar
:/usr/lib/jvm/jre/lib/jsse.jar:/usr/lib/jvm/jre/l
ib/jce.jar:/usr/lib/jvm/jre/lib/charsets.jar:/usr
/lib/jvm/jre/lib/netx.jar:/usr/lib/jvm/jre/lib/pl
ugin.jar:/usr/lib/jvm/jre/lib/rhino.jar:/usr/lib/
jvm/jre/lib/jfr.jar:/usr/lib/jvm/jre/classes
java.awt.headless true
java.vendor Oracle Corporation
file.separator /
java.vendor.url.bug http://bugreport.sun.com/bugreport/
sun.io.unicode.encoding UnicodeLittle
sun.cpu.endian little
sun.cpu.isalist
Then I thought of exploring mounts ;
[/]%
dev/ tmp/ tests/ console/
etc/ tools/ testrunner.so java/
java.so usr/
[/console]% ls
optparse.js pwd.js md5sum.js cd.js
autocomplete.js tests.js cat.js ls.js
init.js cli.js arp.js java.js
perf.js route.js util.js ifconfig.js
dhclient.js run.js help.js
[/console]%
[/etc]% cat hosts
127.0.0.1 localhost osv.local
192.115.211.70 mirror.isoc.org.il
[/etc]%
[/usr/lib]% ls
libexpat.so.1 libz.so.1 libjpeg.so.62
jni/ libfontconfig.so.1 libfreetype.so.6
libnpt.so jvm/
[/usr/lib]%
[/java]% ls
Hello.class RunJava.class
[/java]%
[/]% log ls
NAME LEVEL
javax.management.notification INFO
javax.management.timer INFO
ChannelStream INFO
org.crsh.shell.access INFO
javax.management.modelmbean INFO
log INFO
LoggerFactory INFO
org.crsh.ssh.term.URLKeyPairProvider INFO
org.crsh.plugin.ResourceManager INFO
javax.management.mbeanserver INFO
org.crsh.plugin.PluginManager INFO
org.crsh.auth.JaasAuthenticationPlugin INFO
org.crsh.cli.impl.lang.CommandFactory INFO
ClassCache INFO
InvocationMethodFactory INFO
org.xeustechnologies.jcl.JarClassLoader INFO
crash.commands.cloudius.ls INFO
javax.management.remote.misc INFO
global INFO
org.crsh.shell.impl.command.CRaSHShellFactory INFO
RubyClass INFO
org.crsh.groovy.CommandTransformer INFO
org.crsh.ssh.term.inline.SSHInlinePlugin INFO
PsychParser INFO
crash.commands.cloudius.cat INFO
org.crsh.shell.impl.command.CRaSHSession INFO
TraceType INFO
Main INFO
RubyModule INFO
org.codehaus.groovy.runtime.MetaClassHelper INFO
org.crsh.plugin.PropertyManager INFO
javax.management.snmp INFO
javax.management INFO
org.codehaus.groovy.runtime.DefaultGroovyMethodsSupportINFO
RubyThread INFO
BeanManagerImpl INFO
org.crsh.ssh.SSHPlugin INFO
LoadService INFO
IRScope INFO
javax.management.misc INFO
org.crsh.processor.term.ProcessorIOHandler INFO
org.crsh.ssh.term.SSHLifeCycle INFO
org.crsh.groovy.DefaultImportTransformer INFO
javax.management.monitor INFO
ASTInspector INFO
org.crsh.plugin.PluginContext INFO
RubyRunnable INFO
JavaMethod INFO
javax.management.mlet INFO
ChannelDescriptor INFO
org.crsh.util.InterruptHandler INFO
JavaProxyClassFactory INFO
ThreadContext INFO
crash.commands.cloudius.cd INFO
javax.management.relation INFO
ObjectProxyCache INFO
org.xeustechnologies.jcl.JclObjectFactory INFO
RubyString INFO
org.crsh.util.CloseableList INFO
org.codehaus.groovy.runtime.DefaultGroovyMethods INFO
BasicCompilerPassListener INFO
org.crsh.standalone.CRaSH INFO
javax.management.snmp.daemon INFO
org.crsh.standalone.Bootstrap INFO
JRubyClassLoader INFO
JITCompiler INFO
JavaClass INFO
Ruby INFO
org.crsh.ssh.term.scp.SCPCommandFactory INFO
org.crsh.auth.KeyAuthenticationPlugin INFO
MethodFactory INFO
org.crsh.auth.SimpleAuthenticationPlugin INFO
RubyBasicObject INFO
INFO
[/]% shell plugins
SSHPlugin (initialized)
—————————————————————————
name description type default
————————————————————————–
ssh.port The SSH port Integer 2000
ssh.keypath The path to the key fil String null
e
auth The authentication plug String null
in
—————————————————————————
CommandPlugin (initialized)
—————————————————————————
KeyAuthenticationPlugin (initialized)
—————————————————————————
name description type default
————————————————————————–
auth.key.path The path to the authori String null
zed key file
—————————————————————————
ShellFactory (initialized)
—————————————————————————
TermIOHandler (initialized)
—————————————————————————
AuthenticationPlugin (initialized)
—————————————————————————
name description type default
————————————————————————–
auth.jaas.domain The JAAS domain name us String null
ed for authentication
—————————————————————————
AuthenticationPlugin (initialized)
—————————————————————————
name description type default
————————————————————————–
auth.simple.username The username String admin
auth.simple.password The password String admin
[/]% shell properties
name description type value
——————————————————————————–
auth.simple.password The password String admin
vfs.refresh_unit The refresh time unit TimeUnit null
auth.key.path The path to the authorize String null
d key file
ssh.keypath The path to the key file String null
auth.jaas.domain The JAAS domain name used String null
for authentication
auth.simple.username The username String admin
vfs.refresh_period The refresh rate period Integer 1
ssh.port The SSH port Integer 22
auth The authentication plugin String simple
[/]% perf callstack memory_malloc
freq callstack
100 0x100000b0f43f 0x100000c23cd0 0x100000b09572 0x37d006 0x33325b 0x31afde
40 0x22f3eb 0x22ea95 0x33325b 0x31afde
25 0x100000b0f43f 0x100000aff011 0x100000bf219e 0x10000096a1e0 0x20000021cd8e 0x2000005cea54
5 0x100000b0f43f 0x100000ad75a4 0x100000ad805f 0x100000c72609 0x100000c728c2 0x100000b09572 0x37d006 0x33325b 0x31afde
5 0x100000b0ff4c 0x100000c481c8 0x20000021cd8e 0x200000210158 0x200000210158 0x200000210923 0x200000210333 0x2000002109e1 0x200000210333 0x200000210158
5 0x100000b0f43f 0x100000aff011 0x100000bf219e 0x10000096a1e0 0x20000021cd8e 0x200000210158 0x200000210450 0x200000210333 0x200000210333 0x200000210333
5 0x100002607ce9 0x20000021cd8e 0x200000210275 0x200000210158 0x200000210333 0x200000210333 0x200000210333 0x200000210158 0x200000210158 0x200000210333
3 0x3278cd 0x34b5d1 0x34b743 0x344bdb 0x100002607ad8 0x20000021cd8e 0x200000210158 0x200000210158 0x200000210158 0x200000210158
3 0x30a792 0x327de8 0x3278cd 0x34b5d1 0x34b743 0x344bdb 0x100002607ad8 0x20000021cd8e 0x200000210158 0x200000210158
3 0x30a792 0x327e10 0x3278cd 0x34b5d1 0x34b743 0x344bdb 0x100002607ad8 0x20000021cd8e 0x200000210158 0x200000210158
2 0x34b743 0x344bdb 0x100002607ad8 0x20000021cd8e 0x200000210158 0x200000210158 0x200000210158 0x200000210158 0x200000210158 0x200000210333
2 0x340854 0x3417be 0x1000026096d5 0x20000021cd8e 0x2000002102d4 0x2000002102d4 0x2000002102d4 0x2000002102d4 0x2000002102d4 0x200000210158
2 0x33ef87 0x100003a02817 0x20000021cd8e 0x20000020a50d 0x10000092e259 0x10000092dcf8 0x100000b7a565 0x100000b7b608 0x100000978d04 0x20000021cd8e
1 0x29f6e9 0x29f784 0x2c221f 0x2cecf2 0x33325b 0x31afde
1 0x29f6e9 0x29f784 0x2b23e7 0x2c23fa 0x2cecf2 0x33325b 0x31afde
1 0x2719ec 0x2f7f7b 0x2f867f 0x2b2424 0x2c23fa 0x2cecf2 0x33325b 0x31afde
1 0x2719ec 0x2f7f7b 0x2f867f 0x2b24e1 0x2c23fa 0x2cecf2 0x33325b 0x31afde
1 0x2719ec 0x2f7f7b 0x2f867f 0x2c2415 0x2cecf2 0x33325b 0x31afde
1 0x2719ec 0x2f7f7b 0x2f867f 0x296ff6 0x2c2448 0x2cecf2 0x33325b 0x31afde
1 0x29f6e9 0x29f784 0x29700c 0x2c2448 0x2cecf2 0x33325b 0x31afde
[/]%
Meanwhile I discussed a usability bug [1]( with Pekka and Or Cohen and got it fixed very quickly.. so team is active and on it !!
[1] https://groups.google.com/forum/#!topic/osv-dev/t2I07p5kvO0
References:
1) OSv Project Home Page
2) Osv Git hub
3) OSv presentation
[update]
Very recently ‘Glauber Costa’ came up with a write up on “Comparison between OSv and Containers’.. It should be a worth read..
Humble, thanks for grabbing it that fast and reporting the issue!
Dor, glad to be first user & bug reporter.. 🙂 .. All the best for your new project.. !!
qemu-system-x86_64: -netdev tap,id=hn0,script=qemu-ifup.sh,vhost=on: vhost-net requested but could not be initialized
qemu-system-x86_64: -netdev tap,id=hn0,script=qemu-ifup.sh,vhost=on: Device ‘tap’ could not be initialized
I need these information :
1) libvirtd status.
2) vhost-net module loaded or not.
3) selinux status.