diff --git a/pkg/compute/models/guestnetworks.go b/pkg/compute/models/guestnetworks.go index c2b68fc225..1f1a61c8bb 100644 --- a/pkg/compute/models/guestnetworks.go +++ b/pkg/compute/models/guestnetworks.go @@ -372,9 +372,11 @@ func (self *SGuestnetwork) getJsonDescAtHost(host *SHost) jsonutils.JSONObject { func (self *SGuestnetwork) getJsonDescHostwire(network *SNetwork, hostwire *SHostwire) *jsonutils.JSONDict { desc := self.getJsonDesc(network) - desc.Add(jsonutils.NewString(hostwire.Bridge), "bridge") - desc.Add(jsonutils.NewString(hostwire.WireId), "wire_id") - desc.Add(jsonutils.NewString(hostwire.Interface), "interface") + if hostwire != nil { + desc.Add(jsonutils.NewString(hostwire.Bridge), "bridge") + desc.Add(jsonutils.NewString(hostwire.WireId), "wire_id") + desc.Add(jsonutils.NewString(hostwire.Interface), "interface") + } return desc } diff --git a/pkg/hostman/hostinfo/hostinfo.go b/pkg/hostman/hostinfo/hostinfo.go index 6904c2dd04..7f41393d4b 100644 --- a/pkg/hostman/hostinfo/hostinfo.go +++ b/pkg/hostman/hostinfo/hostinfo.go @@ -856,6 +856,9 @@ func (h *SHostInfo) updateHostRecord(hostId string) { h.onFail(err) } content.Set("mem_size", jsonutils.NewInt(int64(memTotal))) + if len(hostId) == 0 { + content.Set("mem_reserved", jsonutils.NewInt(int64(h.getReservedMem()))) + } content.Set("storage_driver", jsonutils.NewString(api.DISK_DRIVER_LINUX)) content.Set("storage_type", jsonutils.NewString(h.sysinfo.StorageType)) content.Set("storage_size", jsonutils.NewInt(int64(storageman.GetManager().GetTotalCapacity()))) diff --git a/pkg/hostman/storageman/storage_rbd.go b/pkg/hostman/storageman/storage_rbd.go index 1e9f9e596d..27dbe41dfa 100644 --- a/pkg/hostman/storageman/storage_rbd.go +++ b/pkg/hostman/storageman/storage_rbd.go @@ -59,6 +59,10 @@ type SRbdStorage struct { func NewRBDStorage(manager *SStorageManager, path string) *SRbdStorage { var ret = new(SRbdStorage) ret.SBaseStorage = *NewBaseStorage(manager, path) + err := procutils.NewRemoteCommandAsFarAsPossible("mkdir", "-p", "/etc/ceph").Run() + if err != nil { + log.Errorf("Failed to mkdir /etc/ceph: %s", err) + } return ret }