Hi all,
I need some advice to customize my iTop cmdb, Configuration Management
I need to add all servers in my org both physical and virtual. So, we need to know where a virtual server is hosted (in which physical server).
One approach to this is a modification on iTop to allow Server class be dependent on a Application Instance so, the data will result:
server -*depends on*-> application instance -*depends on*-> server
guest server -> vmware/xe/virtual pc instance -> host server
If the host server should be stopped or the vmware install should be patched, I'll get the list of affected virtual-servers
I need some guidance in the process of iTop modification. After modifying the server class I must reinstall iTop? How do you manage virtual and physical servers?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
look at the Extending and Integrating iTop forum, I post a way to add two attributes:
- one for the type of host (physical, ESX, domU, etc)
- one for the physical parent host
Hope it will helpfull
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I created child classes of Server called PhysicalServer and VirtualServer. PhysicalServer has a new tab, VM Guests. VirtualServer has a new field, VM Host. Impact and dependency analysis behave as you would expect.
I modified two files:
/modules/itop-config-mgmt-1.0.0/model.itop-config-mgmt.php
/modules/itop-config-mgmt-1.0.0/en.dict.itop-config-mgmt.php
and created two new images:
/trunk/iTop/modules/itop-config-mgmt-1.0.0/images/physicalserver.png
/trunk/iTop/modules/itop-config-mgmt-1.0.0/images/virtualserver.png
classPhysicalServerextendsServer{publicstaticfunctionInit(){$aParams=array("category"=>"bizmodel,searchable,configmgmt","key_type"=>"autoincrement","name_attcode"=>"name","state_attcode"=>"","reconc_keys"=>array("name","org_id","owner_name","location_id","location_name"),"db_table"=>"physicalserver","db_key_field"=>"id","db_finalclass_field"=>"","icon"=>"../modules/itop-config-mgmt-1.0.0/images/physicalserver.png",);MetaModel::Init_Params($aParams);MetaModel::Init_InheritAttributes();MetaModel::Init_AddAttribute(newAttributeLinkedSet("vm_guests",array("linked_class"=>"VirtualServer","ext_key_to_me"=>"vm_host_instance_id","allowed_values"=>null,"count_min"=>0,"count_max"=>0,"depends_on"=>array())));MetaModel::Init_SetZListItems('details',array('name','status','org_id','importance','brand','model','serial_number','asset_ref','purchase_date','warranty_end','description','location_id','location_details','management_ip','default_gateway','cpu','ram','hdd','os_family','os_version','contact_list','document_list','solution_list','contract_list','ticket_list','nwinterface_list','application_list','patch_list','vm_guests'));MetaModel::Init_SetZListItems('advanced_search',array('name','status','org_id','importance','brand','model','serial_number','asset_ref','description','location_id','location_details','management_ip','default_gateway','cpu','ram','hdd','os_family','os_version'));MetaModel::Init_SetZListItems('standard_search',array('name','status','org_id','importance','brand','model','serial_number','asset_ref','location_id','management_ip','default_gateway','os_family','os_version'));MetaModel::Init_SetZListItems('list',array('status','org_id','importance','brand','model','location_id','os_family'));}publicstaticfunctionGetRelationQueries($sRelCode){switch($sRelCode){case"impacts":$aRels=array("guests"=>array("sQuery"=>"SELECT VirtualServer AS guest WHERE guest.vm_host_instance_id = :this->id","bPropagate"=>true,"iDistance"=>5),"applications"=>array("sQuery"=>"SELECT SoftwareInstance AS app WHERE app.device_id = :this->id","bPropagate"=>true,"iDistance"=>5),"connected_devices"=>array("sQuery"=>"SELECT Device AS dev JOIN NetworkInterface AS if1 ON if1.device_id = dev.id JOIN NetworkInterface AS if2 ON if2.connected_if = if1.id WHERE if2.device_id = :this->id AND if2.link_type='downlink'","bPropagate"=>true,"iDistance"=>5),);returnarray_merge($aRels,parent::GetRelationQueries($sRelCode));break;case"depends on":$aRels=array("connected_devices"=>array("sQuery"=>"SELECT Device AS dev JOIN NetworkInterface AS if1 ON if1.device_id = dev.id JOIN NetworkInterface AS if2 ON if2.connected_if = if1.id WHERE if2.device_id = :this->id AND if2.link_type='uplink'","bPropagate"=>true,"iDistance"=>5),);returnarray_merge($aRels,parent::GetRelationQueries($sRelCode));break;default:returnparent::GetRelationQueries($sRelCode);}}}classVirtualServerextendsServer{publicstaticfunctionInit(){$aParams=array("category"=>"bizmodel,searchable,configmgmt","key_type"=>"autoincrement","name_attcode"=>"name","state_attcode"=>"","reconc_keys"=>array("name","org_id","owner_name","location_id","location_name"),"db_table"=>"virtualserver","db_key_field"=>"id","db_finalclass_field"=>"","icon"=>"../modules/itop-config-mgmt-1.0.0/images/virtualserver.png",);MetaModel::Init_Params($aParams);MetaModel::Init_InheritAttributes();MetaModel::Init_AddAttribute(newAttributeExternalKey("vm_host_instance_id",array("targetclass"=>"PhysicalServer","jointype"=>null,"allowed_values"=>newValueSetObjects('SELECT PhysicalServer WHERE org_id = :this->org_id'),"sql"=>"vm_host_instance_id","is_null_allowed"=>false,"on_target_delete"=>DEL_MANUAL,"depends_on"=>array("org_id"))));MetaModel::Init_SetZListItems('details',array('name','status','org_id','importance','brand','model','serial_number','asset_ref','purchase_date','warranty_end','description','vm_host_instance_id','location_id','location_details','management_ip','default_gateway','cpu','ram','hdd','os_family','os_version','contact_list','document_list','solution_list','contract_list','ticket_list','nwinterface_list','application_list','patch_list'));MetaModel::Init_SetZListItems('advanced_search',array('name','status','org_id','importance','brand','model','serial_number','asset_ref','description','location_id','location_details','management_ip','default_gateway','cpu','ram','hdd','os_family','os_version'));MetaModel::Init_SetZListItems('standard_search',array('name','status','org_id','importance','brand','model','serial_number','asset_ref','location_id','management_ip','default_gateway','os_family','os_version'));MetaModel::Init_SetZListItems('list',array('status','org_id','importance','brand','model','location_id','os_family'));}publicstaticfunctionGetRelationQueries($sRelCode){switch($sRelCode){case"impacts":$aRels=array("applications"=>array("sQuery"=>"SELECT SoftwareInstance AS app WHERE app.device_id = :this->id","bPropagate"=>true,"iDistance"=>5),"connected_devices"=>array("sQuery"=>"SELECT Device AS dev JOIN NetworkInterface AS if1 ON if1.device_id = dev.id JOIN NetworkInterface AS if2 ON if2.connected_if = if1.id WHERE if2.device_id = :this->id AND if2.link_type='downlink'","bPropagate"=>true,"iDistance"=>5),);returnarray_merge($aRels,parent::GetRelationQueries($sRelCode));break;case"depends on":$aRels=array("host"=>array("sQuery"=>"SELECT PhysicalServer AS host WHERE host.id = :this->vm_host_instance_id","bPropagate"=>true,"iDistance"=>5),"connected_devices"=>array("sQuery"=>"SELECT Device AS dev JOIN NetworkInterface AS if1 ON if1.device_id = dev.id JOIN NetworkInterface AS if2 ON if2.connected_if = if1.id WHERE if2.device_id = :this->id AND if2.link_type='uplink'","bPropagate"=>true,"iDistance"=>5),);returnarray_merge($aRels,parent::GetRelationQueries($sRelCode));break;default:returnparent::GetRelationQueries($sRelCode);}}}
FYI, I've submitted enhancement ticket 537 (https://sourceforge.net/apps/trac/itop/ticket/537) to incorporate Virtualisation, Storage, Blades, and Virtual Networking. There's a file attached, and it contains full files and diffs against iTop 1.2.1.
Hope that helps!
/Mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all
i'm working on designing a new data model for next release.
I will have a look at all your posts and will see what can be included in next version
Cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks! I spent the better part of a month working on the code for that (including a lot of time at a white board figuring out the proper relationships between stuff.
/Mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I need some advice to customize my iTop cmdb, Configuration Management
I need to add all servers in my org both physical and virtual. So, we need to know where a virtual server is hosted (in which physical server).
One approach to this is a modification on iTop to allow Server class be dependent on a Application Instance so, the data will result:
server -*depends on*-> application instance -*depends on*-> server
guest server -> vmware/xe/virtual pc instance -> host server
If the host server should be stopped or the vmware install should be patched, I'll get the list of affected virtual-servers
I need some guidance in the process of iTop modification. After modifying the server class I must reinstall iTop? How do you manage virtual and physical servers?
Hello,
look at the Extending and Integrating iTop forum, I post a way to add two attributes:
- one for the type of host (physical, ESX, domU, etc)
- one for the physical parent host
Hope it will helpfull
I created child classes of Server called PhysicalServer and VirtualServer. PhysicalServer has a new tab, VM Guests. VirtualServer has a new field, VM Host. Impact and dependency analysis behave as you would expect.

I modified two files:
/modules/itop-config-mgmt-1.0.0/model.itop-config-mgmt.php
/modules/itop-config-mgmt-1.0.0/en.dict.itop-config-mgmt.php
and created two new images:
/trunk/iTop/modules/itop-config-mgmt-1.0.0/images/physicalserver.png
/trunk/iTop/modules/itop-config-mgmt-1.0.0/images/virtualserver.png
/modules/itop-config-mgmt-1.0.0/model.itop-config-mgmt.php
/modules/itop-config-mgmt-1.0.0/en.dict.itop-config-mgmt.php
Thx !
I will try this as soon as I can.
FYI, I've submitted enhancement ticket 537 (https://sourceforge.net/apps/trac/itop/ticket/537) to incorporate Virtualisation, Storage, Blades, and Virtual Networking. There's a file attached, and it contains full files and diffs against iTop 1.2.1.
Hope that helps!
/Mike
Hi all
i'm working on designing a new data model for next release.
I will have a look at all your posts and will see what can be included in next version
Cheers
etaloc,
Thanks! I spent the better part of a month working on the code for that (including a lot of time at a white board figuring out the proper relationships between stuff.
/Mike