Ian,

Thanks - it seems it is a clone:

[root@tritonia-s5 ~]# zfs get origin 
zones/34f80d9e-f4c0-c9ca-8b60-cd4800f8dcca-disk0
NAME                                              PROPERTY  VALUE               
                              SOURCE
zones/34f80d9e-f4c0-c9ca-8b60-cd4800f8dcca-disk0  origin    
zones/812d34be-e190-11e5-bfdd-e73735c18c34@final  -
[root@tritonia-s5 ~]#

[root@tritonia-s5 ~]# imgadm list | grep 812
812d34be-e190-11e5-bfdd-e73735c18c34  win2012r2x64-trit01  1.0       windows  
zvol        2016-03-03
[root@tritonia-s5 ~]#

PS: I don't WANT to run Windows on my server - but as an independent software 
developer for windows apps.... But I do use Xubuntu with KVM (+ GPU 
pass-through) for my workstation.

Many thanks for your very prompt reply. Cheers

Sean Weatherall
________________________________
From: Ian Collins [[email protected]]
Sent: 04 March 2016 22:22
To: [email protected]
Subject: Re: [smartos-discuss] Windows on KVM differencing disk (golden image)

On 03/05/16 11:06, TRITONIA SOLUTIONS LIMITED wrote:
Hi,

I've been using KVM on Linux (ProxMox VE) for some years and was interested to 
try it out on SmartOS as wanted to use KVM + ZFS (although newer versions of 
ProxMox do support ZFS on Linux). Using qcow2 files on linux, and VHDX files on 
Hyper-V, you can create differencing disks so that you have a single 'parent 
image' which is shared between all of your vm instances (saves a lot of space 
as your obviously only storing changes for each vm).

I created a custom KVM image from a sysprep'd Windows Server 2012 R2 x64 vm and 
imported it locally as in the wiki. From that I was able to generate new vm 
instances but I assume that the zvol created for each new instance is not a 
clone of the original zvol (from the golden image) and thus each new vm is 
getting a copy of the whole original zvol?


>From a ZFS point of view you can check to see if the volume has an "origin" 
>property.

If you have built a KVM from an image, the boot volume should be a clone.  For 
example I have an Ubuntu KVM  built from a Joyent image, thus:

# vmadm get 756317f1-1eb8-427f-880a-8605dc53965b | json disks
[
  {
    "path": "/dev/zvol/rdsk/zones/756317f1-1eb8-427f-880a-8605dc53965b-disk0",
    "boot": true,
    "model": "virtio",
    "media": "disk",
    "image_size": 10240,
    "image_uuid": "b33d4dec-db27-4337-93b5-1f5e7c5b47ce",
    "zfs_filesystem": "zones/756317f1-1eb8-427f-880a-8605dc53965b-disk0",
    "zpool": "zones",
    "size": 10240,
    "compression": "lz4",
    "refreservation": 10240,
    "block_size": 4096
  }
]

The "image_uuid" shows it was built using this image:

# imgadm avail | grep b33d4dec
b33d4dec-db27-4337-93b5-1f5e7c5b47ce  ubuntu-certified-15.04  20150807    linux 
   2015-08-08T04:06:41Z

To verify disk0 is a clone:

# zfs get origin zones/756317f1-1eb8-427f-880a-8605dc53965b-disk0
NAME                                              PROPERTY  VALUE               
                              SOURCE
zones/756317f1-1eb8-427f-880a-8605dc53965b-disk0  origin    
zones/b33d4dec-db27-4337-93b5-1f5e7c5b47ce@final  -

I'm just interested to know if there is a method using a cloned snapshot of the 
original zvol that means I can save all this duplicated space? or maybe I am 
just misunderstanding what imgadm actually does?

PS: I can't really afford the memory to enable dedup on the zones pool.

Good, dedup invariably ends it tears...


Many thanks and sorry for being a novice...

We all started sometime!

--
Ian.


smartos-discuss | 
Archives<redir.aspx?REF=aPHYeYdrc3LNUPsdhs0ikZ122emXgph3qp67t84Fuvwl8uq2fETTCAFodHRwczovL3d3dy5saXN0Ym94LmNvbS9tZW1iZXIvYXJjaGl2ZS8xODQ0NjMvPW5vdw..>
 
[https://www.listbox.com/images/feed-icon-10x10.jpg31e6b2b.jpg?uri=aHR0cHM6Ly93d3cubGlzdGJveC5jb20vaW1hZ2VzL2ZlZWQtaWNvbi0xMHgxMC5qcGc]
 
<redir.aspx?REF=rYtjv9YAM1cntoahcft5B-kHVT5-KJQERxvQgfuytnAl8uq2fETTCAFodHRwczovL3d3dy5saXN0Ym94LmNvbS9tZW1iZXIvYXJjaGl2ZS9yc3MvMTg0NDYzLzI4MDQzODcyLTM3NDNiZWMz>
  | 
Modify<redir.aspx?REF=zFUSvw4WG6tsZ8QKP618mMXTamrOhNEIC7L-C8bimgol8uq2fETTCAFodHRwczovL3d3dy5saXN0Ym94LmNvbS9tZW1iZXIvP21lbWJlcl9pZD0yODA0Mzg3MiZpZF9zZWNyZXQ9MjgwNDM4NzItNWYwMjI3M2Q.>
 Your Subscription 
[https://www.listbox.com/images/listbox-logo-small.png31e6b2b.png?uri=aHR0cHM6Ly93d3cubGlzdGJveC5jb20vaW1hZ2VzL2xpc3Rib3gtbG9nby1zbWFsbC5wbmc]
 
<redir.aspx?REF=DAw4GJn4PxowYaeQjrDVvsAvj5NYazSbM78mdeVSk4cl8uq2fETTCAFodHRwOi8vd3d3Lmxpc3Rib3guY29t>



-------------------------------------------
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com

Reply via email to