Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate disk image using hdiutil #19

Merged
merged 1 commit into from
Nov 22, 2015

Conversation

johanneswuerbach
Copy link
Contributor

As discussed in #18. This removes the libguestfs dependency.

docker-machine -D create -d xhyve --xhyve-disk-size "2000" xhyve
docker@boot2docker:~$ df -h
Filesystem                Size      Used Available Use% Mounted on
tmpfs                   896.6M    123.7M    772.9M  14% /
tmpfs                   498.1M         0    498.1M   0% /dev/shm
/dev/vda1               996.5M      2.0M    926.3M   0% /mnt/vda1
cgroup                  498.1M         0    498.1M   0% /sys/fs/cgroup
/dev/vda1               996.5M      2.0M    926.3M   0% /mnt/vda1/var/lib/docker/aufs
docker info
Containers: 1
Images: 2
Server Version: 1.9.0
Storage Driver: aufs
 Root Dir: /mnt/vda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 4
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 4.1.12-boot2docker
Operating System: Boot2Docker 1.9.0 (TCL 6.4); master : 16e4a2a - Tue Nov  3 19:49:22 UTC 2015
CPUs: 1
Total Memory: 996.3 MiB
Name: boot2docker
ID: TZZC:VPCB:ZLL6:UCV5:HKZZ:4ZCI:XWVB:UHZG:HY5Q:EZER:ABYI:OXP6
Debug mode (server): true
 File Descriptors: 12
 Goroutines: 20
 System Time: 2015-11-22T11:21:38.821801822Z
 EventsListeners: 0
 Init SHA1: 
 Init Path: /usr/local/bin/docker
 Docker Root Dir: /mnt/vda1/var/lib/docker
Labels:
 provider=xhyve

Output as expected 1GB (- 1GB swap created by b2d https://github.com/boot2docker/boot2docker/blob/master/rootfs/rootfs/etc/rc.d/automount#L28)

This is using now the same method as the bundled vbox and hyper-v drivers are using to bootstrap the disk.

I'll remove libguestfs, if you think this is 👍

@zchee
Copy link
Member

zchee commented Nov 22, 2015

@johanneswuerbach LGTM.

I understand all now! Sorry that I can not understand in the discus :(
Check your PR code, and I will merge later.

I want to develop the implementation of tuntap and xpc, so I'm glad to resolve this issue.
Thanks PR, and long discus :)

@zchee
Copy link
Member

zchee commented Nov 22, 2015

@johanneswuerbach Sorry, let me ask you a small question.
Why dmg instead of img? The method, what more the performance will be better? Or another reason?
When using dd, can create img disk image.
Either is fine. but I’m curious about this changed.

@johanneswuerbach
Copy link
Contributor Author

'dmg' is the hdiutil default, actually I planned to use sparse (a vbox like self growing image), but couldn't get it to work and will retry later. Haven't look at performance yet, but docker pull had roughly the same speed as my vbox machine.

@zchee
Copy link
Member

zchee commented Nov 22, 2015

@johanneswuerbach

I planned to use sparse (a vbox like self-growing image)

I do not know exactly sparseimage, but good idea.

but couldn't get it to work and will retry later

Can you tell me the details? It is very interested.

Haven't look at performance yet, but docker pull had roughly the same speed as my vbox machine.

Whether that impression is intuitive? or measurement?
I was easily measured img and vboxfs using the dockernize iozone previously, certainly slow results were obtained.

@zchee
Copy link
Member

zchee commented Nov 22, 2015

Thanks fixed english :)

@johanneswuerbach
Copy link
Contributor Author

xhyve

$ dd if=/dev/zero of=/mnt/vda1/tmp/out bs=8k count=200k; rm -f /mnt/vda1/tmp/out
204800+0 records in
204800+0 records out
1677721600 bytes (1.6GB) copied, 2.531537 seconds, 632.0MB/s

vbox

$ dd if=/dev/zero of=/mnt/sda1/tmp/out bs=8k count=200k; rm -f /mnt/sda1/tmp/out
204800+0 records in
204800+0 records out
1677721600 bytes (1.6GB) copied, 3.222129 seconds, 496.6MB/s

looks sane

@johanneswuerbach
Copy link
Contributor Author

Can you tell me the details? It is very interested.

it failed to format the disk, but I didn't spend much time to investigate why

@johanneswuerbach
Copy link
Contributor Author

I'll remove libguestfs, if you think this is 👍

Done

@zchee
Copy link
Member

zchee commented Nov 22, 2015

@johanneswuerbach
Good!
The xhyve is better than vboxfs, it seems that was a mistake of my measurement.(?)

it failed to format the disk, but I didn't spend much time to investigate why

Ok. I keep in mind the method.

All LGTM.
Merged!

Thank you again :)

zchee added a commit that referenced this pull request Nov 22, 2015
Generate disk image using hdiutil
@zchee zchee merged commit 7a47c5f into machine-drivers:master Nov 22, 2015
@johanneswuerbach johanneswuerbach deleted the hdiutil branch November 22, 2015 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants