{"action":"created","issue":{"url":"https://api.github.com/repos/oetiker/znapzend/issues/171","repository_url":"https://api.github.com/repos/oetiker/znapzend","labels_url":"https://api.github.com/repos/oetiker/znapzend/issues/171/labels{/name}","comments_url":"https://api.github.com/repos/oetiker/znapzend/issues/171/comments","events_url":"https://api.github.com/repos/oetiker/znapzend/issues/171/events","html_url":"https://github.com/oetiker/znapzend/issues/171","id":111197403,"number":171,"title":"Consistent SmartOS KVM snapshots","user":{"login":"aaltonenp","id":7203755,"avatar_url":"https://avatars.githubusercontent.com/u/7203755?v=3","gravatar_id":"","url":"https://api.github.com/users/aaltonenp","html_url":"https://github.com/aaltonenp","followers_url":"https://api.github.com/users/aaltonenp/followers","following_url":"https://api.github.com/users/aaltonenp/following{/other_user}","gists_url":"https://api.github.com/users/aaltonenp/gists{/gist_id}","starred_url":"https://api.github.com/users/aaltonenp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaltonenp/subscriptions","organizations_url":"https://api.github.com/users/aaltonenp/orgs","repos_url":"https://api.github.com/users/aaltonenp/repos","events_url":"https://api.github.com/users/aaltonenp/events{/privacy}","received_events_url":"https://api.github.com/users/aaltonenp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/oetiker/znapzend/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-13T14:53:16Z","updated_at":"2016-03-18T12:49:17Z","closed_at":null,"body":"On SmartOS, KVM virtual machines have a zone dataset and at least one zfs volume for the guest OS, possibly additional volumes for other guest disks.\r\n\r\nThe dataset and all the zvols are top level entities under the zones-pool, for example:\r\n```\r\n[root@smartos01 ~]# zfs list\r\nNAME                                               USED  AVAIL  REFER  MOUNTPOINT\r\nzones                                              227G  5.05T   465K  /zones\r\nzones/053e6212-5cbc-4250-ba2c-90a99cae52a3        4.97G  5.03G  4.97G  /zones/053e6212-5cbc-4250-ba2c-90a99cae52a3\r\nzones/053e6212-5cbc-4250-ba2c-90a99cae52a3-disk0  39.1G  5.07T  9.72G  -\r\nzones/053e6212-5cbc-4250-ba2c-90a99cae52a3-disk1  9.77G  5.06T   320K  -\r\n```\r\n\r\nFor backing up the whole virtual machine in a consistent state, all of these should have their snapshot created at the same point in time, for example:\r\n```\r\nzfs snapshot zones/053e6212-5cbc-4250-ba2c-90a99cae52a3@snap zones/053e6212-5cbc-4250-ba2c-90a99cae52a3-disk0@snap zones/053e6212-5cbc-4250-ba2c-90a99cae52a3-disk1@snap\r\n```\r\nI’m thinking one way to implement this would be to save additional filesystems and/or volumes to snapshot in the configuration for a given master dataset. This way pre- and post-scripts could be per filesystem/volume group and all configuration could be done on the master dataset."},"comment":{"url":"https://api.github.com/repos/oetiker/znapzend/issues/comments/198337717","html_url":"https://github.com/oetiker/znapzend/issues/171#issuecomment-198337717","issue_url":"https://api.github.com/repos/oetiker/znapzend/issues/171","id":198337717,"user":{"login":"aaltonenp","id":7203755,"avatar_url":"https://avatars.githubusercontent.com/u/7203755?v=3","gravatar_id":"","url":"https://api.github.com/users/aaltonenp","html_url":"https://github.com/aaltonenp","followers_url":"https://api.github.com/users/aaltonenp/followers","following_url":"https://api.github.com/users/aaltonenp/following{/other_user}","gists_url":"https://api.github.com/users/aaltonenp/gists{/gist_id}","starred_url":"https://api.github.com/users/aaltonenp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaltonenp/subscriptions","organizations_url":"https://api.github.com/users/aaltonenp/orgs","repos_url":"https://api.github.com/users/aaltonenp/repos","events_url":"https://api.github.com/users/aaltonenp/events{/privacy}","received_events_url":"https://api.github.com/users/aaltonenp/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T12:49:17Z","updated_at":"2016-03-18T12:49:17Z","body":"Yes, that would be a way to do it. For simplicity and a single point of control, I'd like to handle this in the global zone. I could then use a pre-script to send a command to the VM, to checkpoint a database for example. This way all the configuration would in the global zone."}}