{"action":"created","issue":{"url":"https://api.github.com/repos/OpenNebula/addon-drbdmanage/issues/14","repository_url":"https://api.github.com/repos/OpenNebula/addon-drbdmanage","labels_url":"https://api.github.com/repos/OpenNebula/addon-drbdmanage/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/OpenNebula/addon-drbdmanage/issues/14/comments","events_url":"https://api.github.com/repos/OpenNebula/addon-drbdmanage/issues/14/events","html_url":"https://github.com/OpenNebula/addon-drbdmanage/issues/14","id":247597967,"number":14,"title":"Clone operation generates bad drbd resource set up","user":{"login":"mjtbrady","id":3741702,"avatar_url":"https://avatars3.githubusercontent.com/u/3741702?v=4","gravatar_id":"","url":"https://api.github.com/users/mjtbrady","html_url":"https://github.com/mjtbrady","followers_url":"https://api.github.com/users/mjtbrady/followers","following_url":"https://api.github.com/users/mjtbrady/following{/other_user}","gists_url":"https://api.github.com/users/mjtbrady/gists{/gist_id}","starred_url":"https://api.github.com/users/mjtbrady/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjtbrady/subscriptions","organizations_url":"https://api.github.com/users/mjtbrady/orgs","repos_url":"https://api.github.com/users/mjtbrady/repos","events_url":"https://api.github.com/users/mjtbrady/events{/privacy}","received_events_url":"https://api.github.com/users/mjtbrady/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-08-03T05:42:39Z","updated_at":"2017-08-03T18:39:31Z","closed_at":null,"body":"Any (I think) clone operation produces a bad drbd set up for the cloned resource.\r\n\r\nFor example.\r\n\r\nSame drbdmanage set up as before.  One node without  storage and two with.\r\n```\r\n[root@one01 drbdmanage]# drbdmanage list-nodes\r\n+---------------------------------------------------------------------------------------+\r\n| Name                 | Pool Size | Pool Free |                           |      State |\r\n|---------------------------------------------------------------------------------------|\r\n| kvm08.devnull.net.nz |   1048576 |   1042703 |                           |         ok |\r\n| kvm12.devnull.net.nz |   1048576 |   1042703 |                           |         ok |\r\n| one01.devnull.net.nz |         0 |         0 |                           | no storage |\r\n+---------------------------------------------------------------------------------------+\r\n```\r\nCreate a new image in a drbdmanage datastore.  I just uploaded an ISO that I had on my desktop with Sunstone .  This works (apart from the previously mentioned errors in the logs) and shows correctly at  the drbd level\r\n```\r\n[root@one01 drbdmanage]# drbdadm status OpenNebula-image-26\r\nOpenNebula-image-26 role:Secondary\r\n  disk:Diskless\r\n  kvm08.devnull.net.nz role:Secondary\r\n    peer-disk:UpToDate\r\n  kvm12.devnull.net.nz role:Secondary\r\n    peer-disk:UpToDate\r\n```\r\nand has the following config file\r\n```\r\n[root@one01 drbd.d]# cat drbdmanage_OpenNebula-image-26.res \r\nresource OpenNebula-image-26 {\r\ntemplate-file \"/var/lib/drbd.d/drbdmanage_global_common.conf\";\r\n\r\n   net {\r\n       shared-secret \"taYeagJtM5ClAw3ABcCH\";\r\n       cram-hmac-alg sha1;\r\n   }\r\n    on one01.devnull.net.nz {\r\n        node-id 2;\r\n        address ipv4 192.168.48.25:7008;\r\n        volume 0 {\r\n            device minor 196;\r\n            disk none;\r\n            meta-disk internal;\r\n        }\r\n    }\r\n    on kvm08.devnull.net.nz {\r\n        node-id 0;\r\n        address ipv4 192.168.48.23:7008;\r\n        volume 0 {\r\n            device minor 196;\r\n            disk /dev/vg_sys/OpenNebula-image-26_00;\r\n            disk {\r\n                size 1097728k;\r\n            }\r\n            meta-disk internal;\r\n        }\r\n    }\r\n    on kvm12.devnull.net.nz {\r\n        node-id 1;\r\n        address ipv4 192.168.48.24:7008;\r\n        volume 0 {\r\n            device minor 196;\r\n            disk /dev/vg_sys/OpenNebula-image-26_00;\r\n            disk {\r\n                size 1097728k;\r\n            }\r\n            meta-disk internal;\r\n        }\r\n    }\r\n    connection-mesh {\r\n        hosts kvm08.devnull.net.nz kvm12.devnull.net.nz;\r\n    }\r\n    connection {\r\n        host one01.devnull.net.nz;\r\n        host kvm08.devnull.net.nz;\r\n    }\r\n    connection {\r\n        host one01.devnull.net.nz;\r\n        host kvm12.devnull.net.nz;\r\n    }\r\n}\r\n```\r\n and the underlying thin LVs exist as expected on both kvm08 and kvm12\r\n```\r\n[root@kvm08 datastores]# lvs | grep OpenNebula-image-26\r\n  OpenNebula-image-26_00            vg_sys Vwi-aotz--   1.05g lv_drbd_pool        99.67\r\n```\r\n```\r\n[root@kvm12 drbd.d]# lvs | grep OpenNebula-image-26\r\n  OpenNebula-image-26_00            vg_sys Vwi-aotz--   1.05g lv_drbd_pool        99.67 \r\n```\r\nNow clone this image.  I did it in Sunstone.\r\nThis produces the following \r\n```\r\n[root@one01 drbd.d]# drbdadm status OpenNebula-clone-27\r\nOpenNebula-clone-27 role:Secondary\r\n  disk:Diskless\r\n  kvm08.devnull.net.nz connection:Connecting\r\n  kvm12.devnull.net.nz role:Secondary\r\n    peer-disk:UpToDate\r\n```\r\nand the following configuration file\r\n```\r\n[root@one01 drbd.d]# cat drbdmanage_OpenNebula-clone-27.res\r\nresource OpenNebula-clone-27 {\r\ntemplate-file \"/var/lib/drbd.d/drbdmanage_global_common.conf\";\r\n\r\n   net {\r\n       shared-secret \"rJ7Cvzop0+mnEr53y5nf\";\r\n       cram-hmac-alg sha1;\r\n   }\r\n    on one01.devnull.net.nz {\r\n        node-id 2;\r\n        address ipv4 192.168.48.25:7009;\r\n        volume 0 {\r\n            device minor 197;\r\n            disk none;\r\n            meta-disk internal;\r\n        }\r\n    }\r\n    on kvm08.devnull.net.nz {\r\n        node-id 0;\r\n        address ipv4 192.168.48.23:7009;\r\n        volume 0 {\r\n            device minor 197;\r\n            disk /dev/vg_sys/OpenNebula-clone-27_00;\r\n            disk {\r\n                size 1097728k;\r\n            }\r\n            meta-disk internal;\r\n        }\r\n    }\r\n    on kvm12.devnull.net.nz {\r\n        node-id 1;\r\n        address ipv4 192.168.48.24:7009;\r\n        volume 0 {\r\n            device minor 197;\r\n            disk /dev/null;\r\n            disk {\r\n                size 1097728k;\r\n            }\r\n            meta-disk internal;\r\n        }\r\n    }\r\n    connection-mesh {\r\n        hosts kvm08.devnull.net.nz kvm12.devnull.net.nz;\r\n    }\r\n    connection {\r\n        host one01.devnull.net.nz;\r\n        host kvm08.devnull.net.nz;\r\n    }\r\n    connection {\r\n        host one01.devnull.net.nz;\r\n        host kvm12.devnull.net.nz;\r\n    }\r\n}\r\n```\r\nwith the following LVs \r\n```\r\n[root@kvm08 datastores]# lvs | grep OpenNebula-clone-27\r\n```\r\n```\r\n[root@kvm12 drbd.d]# lvs | grep OpenNebula-clone-27\r\n  OpenNebula-clone-27_00            vg_sys Vwi-aotz--   1.05g lv_drbd_pool        99.67\r\n```\r\n\r\nThis is completely messed up.  kvm12 has a disk of /dev/null configured and does have the expected LV and kvm08 has a disk of /dev/vg_sys/OpenNebula-clone-27_00 configured and does not have the LV.\r\n\r\nThe same thing happens when deploying a VM with non-persistent disks, which also does a clone.\r\n\r\nI think that I have tracked this down to the \"drbdmange deploy\" call in drbd_distribute_clients().  For the import this function seems to do what it is supposed to.  For a clone operation it doesn't.\r\n\r\nA few things:\r\n1. I do not have a site configured.  Therefore \"drbdmange deploy\" is being called with \"--site\".  i.e. no site, but all the occurrences of --site in the drbdmanage man pages show --site as requiring a parameter and yet this doesn't error out?\r\n2. I can't find any documentation on what the \"--with-clients\" option is supposed to do.  It is listed on the drbdmanage-deploy-resource man page, but there is no explanation as to its function.\r\n3. If I bypass drbd_distribute_clients() altogether (I put an \"exit 0\" in as the first line) the upload doesn't work correctly (it uploads, but is only deployed to the nodes with storage as you would expect), but the clone operations do work (although I wouldn't expect them to, the cloned resource is deployed correctly to all three nodes).\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/OpenNebula/addon-drbdmanage/issues/comments/320055024","html_url":"https://github.com/OpenNebula/addon-drbdmanage/issues/14#issuecomment-320055024","issue_url":"https://api.github.com/repos/OpenNebula/addon-drbdmanage/issues/14","id":320055024,"user":{"login":"mjtbrady","id":3741702,"avatar_url":"https://avatars3.githubusercontent.com/u/3741702?v=4","gravatar_id":"","url":"https://api.github.com/users/mjtbrady","html_url":"https://github.com/mjtbrady","followers_url":"https://api.github.com/users/mjtbrady/followers","following_url":"https://api.github.com/users/mjtbrady/following{/other_user}","gists_url":"https://api.github.com/users/mjtbrady/gists{/gist_id}","starred_url":"https://api.github.com/users/mjtbrady/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjtbrady/subscriptions","organizations_url":"https://api.github.com/users/mjtbrady/orgs","repos_url":"https://api.github.com/users/mjtbrady/repos","events_url":"https://api.github.com/users/mjtbrady/events{/privacy}","received_events_url":"https://api.github.com/users/mjtbrady/received_events","type":"User","site_admin":false},"created_at":"2017-08-03T18:39:31Z","updated_at":"2017-08-03T18:39:31Z","body":"> 2 is a positional argument of drbdmange deploy it's the number of nodes to deploy with storage.\r\n> \r\n> --with-clients takes no arguments and assigns the resource to the rest of the nodes in the site.\r\n> \r\n> Site with no argument is parsed as \"\" which is the default value and the default behavior assigns them to all the nodes in the cluster. This is convenient for me because there's no special case in building the command before it's run, I didn't imagine at the time that the commands would be viewed out of context.\r\n\r\nThanks for explaining what theses options are supposed to do.  I do not understand what is out of context here."}}
{"actor":{"display_login":"mjtbrady"}}