cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a new type on a running cluster without using types.cf

Andy_Tsouladze
Level 3
I am in a process of writing a new agent. I would like to have a new type MyApp, with type definitions stored in MyAppType.cf file. I cannot stop the cluster to add `include "MyAppType.cf"' to main.cf

hatype -add

does not accept any options like `-SourceFile '. Come to think of it, I guess it would not hurt to have such option. Any Veritas guys around to take this as a suggestion?

I also tried

haattr -default MyApp SourceFile ./MyAppType.cf

and got a warning, with no action taken.

Can this be accomplished? (VCS 4.1, Solaris 8)

Andy
3 REPLIES 3

Yasuhisa_Ishika
Level 6
Partner Accredited Certified
I can't find option to specify the file of type defnition.
I recommend you to do as follows. In this way VCS once stops, but services are still active.

1. Run "haconf -dump -makero" to close configuration.

2. "hastop -all -force" to stop VCS. Services are still active.

3. Create /etc/VRTSvcs/conf/config/MyAppType.cf. MyAppType.cf must contain type definition like below
-----
type Test (
)
-----

4. Add include statement of MyAppType.cf to main.cf.

5. Run "hastart" on the node where you did step 3 and 4.

6. After the node become RUNING state, run "hastart" on all ohter nodes.

7. Modify resource attributes by "hatype" as you like.

Eric_Hennessey1
Level 5
Employee Certified
This approach WILL work, however it requires stopping HA.The best way to do this is to create your MyAppTypes.cf file, then from the VCS GUI, clicke "File", then "Import Types". A dialog box will come up where you browse for the .cf file you just created, and the new type will be imported into the running configuration.If you MUST do this from the command line, it's possible to do, but requires about 40 commands to set all the correct default attribute values.Try it on a running cluster with the following types file, then look at the engine log to see all the commands that get generated:type MyApp ( static str ArgList[] = { MyAttr1, MyAttr2 } str MyAttr1 str MyAttr2)

Ralph_G_stenm1
Level 2
Hi Andy
a common way to add new agents to an running cluster is:

1. Create the MyApp.cf
2. Create a simple main.cf with contains
include "MyApp.cf"

3. Run hacf -cftocmd .

This will create a main.cmd, containing all commands for adding the new typ.

So, you will see that the desired command is
hatype -add MyApp
hatype -modify MyApp SourceFile "./MyApp.cf"

Ralph