[PATCH master] kvm: use_guest_agent: QEMU Guest Agent support

2016-09-30 Thread Robin H. Johnson
Implement the QEMU Guest Agent sockets, so that code/scripts on the
hypervisors can communicate with guest operating systems easily.

Signed-off-by: Robin H. Johnson 
---
 lib/hypervisor/hv_kvm/__init__.py | 30 ++
 man/gnt-instance.rst  |  7 +++
 src/Ganeti/Constants.hs   |  5 +
 3 files changed, 42 insertions(+)

diff --git a/lib/hypervisor/hv_kvm/__init__.py 
b/lib/hypervisor/hv_kvm/__init__.py
index f3c1d60..0f1c05d 100644
--- a/lib/hypervisor/hv_kvm/__init__.py
+++ b/lib/hypervisor/hv_kvm/__init__.py
@@ -497,6 +497,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
 constants.HV_MIGRATION_BANDWIDTH: hv_base.REQ_NONNEGATIVE_INT_CHECK,
 constants.HV_MIGRATION_DOWNTIME: hv_base.REQ_NONNEGATIVE_INT_CHECK,
 constants.HV_MIGRATION_MODE: hv_base.MIGRATION_MODE_CHECK,
+constants.HV_USE_GUEST_AGENT: hv_base.NO_CHECK,
 constants.HV_USE_LOCALTIME: hv_base.NO_CHECK,
 constants.HV_DISK_CACHE:
   hv_base.ParamInSet(True, constants.HT_VALID_CACHE_TYPES),
@@ -751,6 +752,13 @@ class KVMHypervisor(hv_base.BaseHypervisor):
 """
 return utils.PathJoin(cls._CTRL_DIR, "%s.qmp" % instance_name)
 
+  @classmethod
+  def _InstanceQemuGuestAgentMonitor(cls, instance_name):
+"""Returns the instance serial QEMU Guest Agent socket name
+
+"""
+return utils.PathJoin(cls._CTRL_DIR, "%s.qga" % instance_name)
+
   @classmethod
   def _InstanceKvmdMonitor(cls, instance_name):
 """Returns the instance kvm daemon socket name
@@ -837,6 +845,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
 utils.RemoveFile(cls._InstanceMonitor(instance_name))
 utils.RemoveFile(cls._InstanceSerial(instance_name))
 utils.RemoveFile(cls._InstanceQmpMonitor(instance_name))
+utils.RemoveFile(cls._InstanceQemuGuestAgentMonitor(instance_name))
 utils.RemoveFile(cls._InstanceKVMRuntime(instance_name))
 utils.RemoveFile(cls._InstanceKeymapFile(instance_name))
 uid_file = cls._InstanceUidFile(instance_name)
@@ -1551,6 +1560,27 @@ class KVMHypervisor(hv_base.BaseHypervisor):
 if self._UUID_RE.search(kvmhelp):
   kvm_cmd.extend(["-uuid", instance.uuid])
 
+# Add guest agent socket
+if hvp[constants.HV_USE_GUEST_AGENT]:
+  qga_addr = utils.GetFreeSlot(pci_reservations, reserve=True)
+  qga_pci_info = ",bus=pci.0,addr=%s" % hex(qga_addr)
+  qga_path = self._InstanceQemuGuestAgentMonitor(instance.name)
+  logging.info("KVM: Guest Agent available at %s", path)
+  # The 'qga0' identified can change, but the 'org.qemu.guest_agent.0' 
string is
+  # the default expected by the Guest Agent.
+  kvm_cmd.extend([
+"-chardev",
+"socket,path=%s,server,nowait,id=qga0" % qga_path,
+])
+  kvm_cmd.extend([
+"-device",
+"virtio-serial,id=qga0%s" % qga_pci_info,
+])
+  kvm_cmd.extend([
+"-device",
+"virtserialport,chardev=qga0,name=org.qemu.guest_agent.0",
+])
+
 if hvp[constants.HV_KVM_EXTRA]:
   kvm_cmd.extend(hvp[constants.HV_KVM_EXTRA].split(" "))
 
diff --git a/man/gnt-instance.rst b/man/gnt-instance.rst
index 283392c..493ae92 100644
--- a/man/gnt-instance.rst
+++ b/man/gnt-instance.rst
@@ -545,6 +545,13 @@ viridian
 viridian (Hyper-V) for this instance. The default is false,
 disabling viridian support.
 
+use\_guest\_agent
+Valid for the KVM hypervisor.
+
+A boolean option that specifies if the hypervisor should enable
+the QEMU Guest Agent protocol for this instance. By default, the
+Guest Agent is disabled.
+
 use\_localtime
 Valid for the Xen HVM and KVM hypervisors.
 
diff --git a/src/Ganeti/Constants.hs b/src/Ganeti/Constants.hs
index 1e0b877..ba2b5f2 100644
--- a/src/Ganeti/Constants.hs
+++ b/src/Ganeti/Constants.hs
@@ -1844,6 +1844,9 @@ hvUsbMouse = "usb_mouse"
 hvUseBootloader :: String
 hvUseBootloader = "use_bootloader"
 
+hvUseGuestAgent :: String
+hvUseGuestAgent = "use_guest_agent"
+
 hvUseLocaltime :: String
 hvUseLocaltime = "use_localtime"
 
@@ -1979,6 +1982,7 @@ hvsParameterTypes = Map.fromList
   , (hvUsbDevices,  VTypeString)
   , (hvUsbMouse,VTypeString)
   , (hvUseBootloader,   VTypeBool)
+  , (hvUseGuestAgent,   VTypeBool)
   , (hvUseLocaltime,VTypeBool)
   , (hvVga, VTypeString)
   , (hvVhostNet,VTypeBool)
@@ -4143,6 +4147,7 @@ hvcDefaults =
   , (hvMigrationBandwidth,  PyValueEx (32 :: Int))
   , (hvMigrationDowntime,   PyValueEx (30 :: Int))
   , (hvMigrationMode,   PyValueEx htMigrationLive)
+  , (hvUseGuestAgent,   PyValueEx False)
   , (hvUseLocaltime,PyValueEx False)
   , (hvDiskCache,   PyValueEx htCacheDefault)
   , (hvSecurityModel,   

Re: Issue 89 in ganeti: Not all cluster parameters are editable

2016-09-30 Thread ganeti


Comment #7 on issue 89 by robbat2@gmail.com: Not all cluster parameters  
are editable

https://code.google.com/p/ganeti/issues/detail?id=89

Changing ip_version would be really useful here too.

--
You received this message because this project is configured to send all  
issue notifications to this address.

You may adjust your notification preferences at:
https://code.google.com/hosting/settings


Issue 1190 in ganeti: GitHub PR sync to mailing list not running

2016-09-30 Thread ganeti

Status: New
Owner: 

New issue 1190 by robbat2@gmail.com: GitHub PR sync to mailing list not  
running

https://code.google.com/p/ganeti/issues/detail?id=1190

What steps will reproduce the problem?
1. Submit a GitHub PR, per the instruction in the Development documentation.
2. Wait for PR to be cross-posted to the mailing list
3. Doesn't happen

What is the expected output? What do you see instead?
The documentation states: "Pull requests are automatically forwarded to the  
ganeti-devel@googlegroups.com mailing list, where the patch can then be  
discussed."


--
You received this message because this project is configured to send all  
issue notifications to this address.

You may adjust your notification preferences at:
https://code.google.com/hosting/settings


Re: RFC: Releasing Ganeti 2.15.3

2016-09-30 Thread 'Iustin Pop' via ganeti-devel
On 30 September 2016 at 12:30, 'Brian Foley' via ganeti-devel <
ganeti-devel@googlegroups.com> wrote:

> On Fri, Sep 30, 2016 at 11:47:24AM +0200, Iustin Pop wrote:
> >On 29 September 2016 at 19:21, 'Brian Foley' via ganeti-devel
> ><[1]ganeti-devel@googlegroups.com> wrote:
> >
> >  Hi all,
> >  since December 2015 quite a large number of commits have been made
> >  to the
> >  stable-2.15 branch (87 to be exact). These cover the gamut from
> >  performance
> >  improvements, to compatibility fixes, to error handling, and even
> >  some minor
> >  feature improvements. There should be no compatibility breaks
> >  though.
> >  You can see the full list with git log --oneline
> >  v2.15.2..stable-2.15
> >  I've tried to categorise them all below. I'd like us to do a
> >  (final?) patch
> >  release of 2.15.3, as the patches includes an important fix for
> >  socat 1.7.3
> >  compatibility that's affected quite a few users.
> >  Does anyone else have anything they'd really like to see fixed in
> >  2.15, or does
> >  anyone have any objections to including any of the below in a point
> >  release?
> >
> >As far as my investigations on
> >[2]https://code.google.com/p/ganeti/issues/detail?id=1185 went, it
> >seems that the location setup tags completely broke htools on clusters
> >with non-DRBD instances. It's a trivial breakage, not a design one, so
> >fixing it shouldn't be too invasive.
> >Day work has been crazy busy so I didn't manage to finish up a patch,
> >but I think this should be fixed in 2.15 stable. When were you
> planning
> >the release for?
>
> Hi Iustin,
>
> I completely forgot about #1185. Yeah, it would definitely be worth fixing
> this if it's not too hard.
>
> I was hoping to get a release done in the next 2-3 weeks if we could, but
> I've no fixed schedule in mind and I'll go with whatever suits people.
>

Ah, OK, that should very doable. I thought you're planning for the next few
days; I'll try to send a patch then sometimes next week.

thanks!
iustin


Re: RFC: Releasing Ganeti 2.15.3

2016-09-30 Thread 'Brian Foley' via ganeti-devel
On Fri, Sep 30, 2016 at 11:47:24AM +0200, Iustin Pop wrote:
>On 29 September 2016 at 19:21, 'Brian Foley' via ganeti-devel
><[1]ganeti-devel@googlegroups.com> wrote:
> 
>  Hi all,
>  since December 2015 quite a large number of commits have been made
>  to the
>  stable-2.15 branch (87 to be exact). These cover the gamut from
>  performance
>  improvements, to compatibility fixes, to error handling, and even
>  some minor
>  feature improvements. There should be no compatibility breaks
>  though.
>  You can see the full list with git log --oneline
>  v2.15.2..stable-2.15
>  I've tried to categorise them all below. I'd like us to do a
>  (final?) patch
>  release of 2.15.3, as the patches includes an important fix for
>  socat 1.7.3
>  compatibility that's affected quite a few users.
>  Does anyone else have anything they'd really like to see fixed in
>  2.15, or does
>  anyone have any objections to including any of the below in a point
>  release?
> 
>As far as my investigations on
>[2]https://code.google.com/p/ganeti/issues/detail?id=1185 went, it
>seems that the location setup tags completely broke htools on clusters
>with non-DRBD instances. It's a trivial breakage, not a design one, so
>fixing it shouldn't be too invasive.
>Day work has been crazy busy so I didn't manage to finish up a patch,
>but I think this should be fixed in 2.15 stable. When were you planning
>the release for?

Hi Iustin,

I completely forgot about #1185. Yeah, it would definitely be worth fixing
this if it's not too hard.

I was hoping to get a release done in the next 2-3 weeks if we could, but
I've no fixed schedule in mind and I'll go with whatever suits people.

Cheers,
Brian.


Re: RFC: Releasing Ganeti 2.15.3

2016-09-30 Thread 'Iustin Pop' via ganeti-devel
On 29 September 2016 at 19:21, 'Brian Foley' via ganeti-devel <
ganeti-devel@googlegroups.com> wrote:

> Hi all,
>
> since December 2015 quite a large number of commits have been made to the
> stable-2.15 branch (87 to be exact). These cover the gamut from performance
> improvements, to compatibility fixes, to error handling, and even some
> minor
> feature improvements. There should be no compatibility breaks though.
>
> You can see the full list with git log --oneline v2.15.2..stable-2.15
>
> I've tried to categorise them all below. I'd like us to do a (final?) patch
> release of 2.15.3, as the patches includes an important fix for socat 1.7.3
> compatibility that's affected quite a few users.
>
> Does anyone else have anything they'd really like to see fixed in 2.15, or
> does
> anyone have any objections to including any of the below in a point
> release?
>

As far as my investigations on
https://code.google.com/p/ganeti/issues/detail?id=1185 went, it seems that
the location setup tags completely broke htools on clusters with non-DRBD
instances. It's a trivial breakage, not a design one, so fixing it
shouldn't be too invasive.

Day work has been crazy busy so I didn't manage to finish up a patch, but I
think this should be fixed in 2.15 stable. When were you planning the
release for?

thanks,
iustin