Polymorphism And Type Casting In Storage Volume Connections
AssigneeRed Hat, Inc.
InventorHuamin Chen
Life of this patent
Estimating the term…
Abstract
Aspects of the disclosure provide for polymorphism and type casting in storage volume connections. A method of the disclosure includes receiving an identifier of a persistent volume (PV) created on a storage device and list of polymorphic connection types supported by the PV, creating a PV record for the PV at the container manager, responsive to receiving a query of the PV record from a container host, performing, for a connection from the container host to the storage device, type casting to select a connection type from the list of polymorphic connection types, and returning the identifier of the PV and connection information to cause the container host to establish the connection to the storage device via the selected connection type.
Claims20
A method comprising:
- receiving, by a processing device executing a container manager, an identifier of a persistent volume (PV) created on a storage device and a list of polymorphic connection types supported by the PV;
- creating a PV record for the PV at the container manager;
- responsive to receiving a query of the PV record from a container host, performing, for a connection from the container host to the storage device, type casting to identify a connection type from the list of polymorphic connection types and connection information for the connection type to enable establishment of the connection between the container host and the storage device, wherein the connection information is different for each of the polymorphic connection types;
- and
- returning, to the container host in response to the query, the identifier of the PV and the connection information to cause the container host to establish the connection to the storage device via the selected connection type.
A non-transitory machine-readable storage medium including instructions that, when executed by a processing device, cause the processing device to:
- transmit, by the processing device to a container manager, a query for a persistent volume (PV) record maintained by the container manager, the query comprising a name of the PV and node information of a container host comprising the processing device;
- receive, by the processing device from the container manager, an identifier of the PV and connection information, wherein the connection information is specific to a connection type that is type casted by the container manager, using the node information, from a plurality of polymorphic connection types supported by the PV, wherein the connection information to enable establishment of the connection between the container host and the storage device, wherein the connection information is different for each of the polymorphic connection types;
- and
- establish, by the processing device using the connection information, a connection to the storage device via the connection type.
An apparatus comprising:
- a memory to store persistent volume (PV) records corresponding to PVs created on a storage device, wherein each PV record comprises a PV identifier and a list of polymorphic connection types supported by the PV corresponding to the PV record;
- and
- a processing device communicably coupled to the memory, to:
- execute a container manager to manage one or more containers on one or more container hosts;
- responsive to receiving a query for one of the PV records from a container host, perform type casting associated with a connection from the container host to the storage device, wherein performing the type casting comprises identifying a connection type from the list of polymorphic connection types in view of node information of the container host comprised in the query and identifying connection information for the connection type to enable establishment of the connection between the container host and the storage device, and wherein the connection information is different for each of the polymorphic connection types;
- and
- transmit, to the container host in response to the query, the identifier of the PV and connection information to cause the container host to establish the connection to the storage device via the selected connection type, wherein the connection information is different for each of the polymorphic connection types.
Dependencies are inferred from the claim text.